PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Naming one's hostname for sp_who
Date: Oct 9 2001 4:34PM

David LANDGREN writes:
 > |Or add this to DBlib.xs and call before making a connection:
 > |
 > |void
 > |DBSETLHOST(host)
 > |    char *    host
 > |CODE:
 > |{
 > |    DBSETLHOST(loginrec, host);
 > |}
 > |
 > |Put this around line 4540 of DBlib.xs (where you also have the
 > |definitions of DBSETLCHARSET, etc), rebuild, and then call with
 > |Sybase::DBlib::DBSETLHOST("my_host");
 > 
 > I had to s/loginrec/login/ to get it to compile (it seemed like the right
 > thing to do). I had version 2.12. At least I'm up to date with 2.13 now...
 > Anyway, I ran the following test
 > 
 > #! /usr/bin/perl -w
 > 
 > use strict;
 > use Sybase::DBlib;
 > 
 > my $db = Sybase::DBlib->new( shift, shift, 'ouessant', 'foo' );
 > Sybase::DBlib::DBSETLHOST( 'sybhost' );
 > 
 > sleep 60;
 > __END__
 > 
 > The connection shows up in sp_who, but the hostname column is still
 > reporting ouessant. Pity, it sounded like a good idea.

You need to call DBSETLHOST() before calling new(). See the man page
on DBSETLHOST() in the DB-Library manual.

Michael
-- 
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
mpeppler@peppler.org - mpeppler@mbay.net
International Sybase User Group - http://www.isug.com