Michael,
I believe I have found my issue. The database names on the SQLServer
contain minus '-' characters. I have re-created a test set using
underscore '_' characters and the scripts now select data form the
correct database. I am assuming that minus '-' characters are bad...
Trace level 1 dump below, somewhat chopped to get it all to fit. Only
connect and disconnect traces are below...
BTW: There are two connections here to two different servers. The .148
is a MSSQL2000 server and the .160 is a MSSQL7 server, hence the two
different error messages returned. So question is where is the error
coming from? DBD::Sybase, FreeTDS or the MSSQL server or there internals.
Thanks again for your help...
DBI 1.21-nothread dispatch trace level set to 1
->
DBI->connect(dbi:Sybase:server=166.34.175.148;database=staffplan-2002,
sp2002_user, ****)
-> DBI->install_driver(Sybase) for linux perl=5.006 pid=6097
ruid=1119 euid=1119
install_driver: DBD::Sybase version 0.94 loaded from
/usr/lib/perl5/site_perl/5.6.0/i386-linux/DBD/Sybase.pm
<- install_driver= DBI::dr=HASH(0x8182584)
!! ERROR: 911 'Server message number=911 severity=16 state=1 line=1
server=COSSQL01 text=Could not locate entry in sysdatabases for database
'staffplan'. No entry found with that name. Make sure that the name is
entered correctly.'
<- connect= DBI::db=HASH(0x80fc3c0) at DBI.pm line 471
<- STORE('PrintError' 1 ...)= 1 at DBI.pm line 513
<- STORE('AutoCommit' 1 ...)= 1 at DBI.pm line 513
<- connect= DBI::db=HASH(0x80fc3c0)
<- STORE('AutoCommit' 1 ...)= 1 at SQL_DRIVER.pm line 106
->
DBI->connect(dbi:Sybase:server=166.34.175.160;database=staffplan-2002,
sp2002_user, ****)
!! ERROR: 170 'Server message number=170 severity=15 state=1 line=1
server=COSDEV01 text=Line 1: Incorrect syntax near '-'.'
<- connect= DBI::db=HASH(0x80fc3f0) at DBI.pm line 471
<- STORE('PrintError' 1 ...)= 1 at DBI.pm line 513
<- STORE('AutoCommit' 1 ...)= 1 at DBI.pm line 513
<- connect= DBI::db=HASH(0x80fc3f0)
<- STORE('AutoCommit' 1 ...)= 1 at SQL_DRIVER.pm line 106
..
.. All the delete, insert statements
..
<- disconnect= 1 at SQL_DRIVER.pm line 161
<- disconnect= 1 at SQL_DRIVER.pm line 161
<- DESTROY= undef
<- DESTROY= undef
<- disconnect_all= 1 at DBI.pm line 533
<- DESTROY= undef during global destruction
Michael Peppler wrote:
> > Are you positive that this user can access each of these databases?
> Yes...When the script is run on a Win32 platform using DBD::ODBC I can
> specify the username and password and get the specified data from the
> specified database. with the DBD::Sybase driver all data for all
> combinations comes form the users 'default' database.
>
> > Right - this comes from dbdimp.c, in the syb_db_use() function. In
> > general there should be some other errors associated with that -
> > messages from the server - something like:
> the only message what I see, and I believe its a warning, is the 'cant
> change context'
>
> > Have you tried a simple $dbh->do('use my_database2'); to see if that
> No...I have not and not even sure if thats a valid test for my scenario...
>
> DB SERVER is a WinNT Server w/ SQL Server 7.0
> Clients are a different WinNt server and a Linux RH7.2 using DBD::Sybase
> and FreeTDS
>
> > I really don't think that this is the case. It *is* possible that this
> > is a bug in the FreeTDS libraries, though.
> Only reason I say this is that the script function correctly with
> DBD::ODBC on win32.
>
> Michael Peppler wrote:
>
>> Bill McClintock writes:
>> > USER:
>> > my_user w/ access to all four my_databaseX but 'my_database1' is
>> default
>>
>> Are you positive that this user can access each of these databases?
>>
>> > [bmcclint@BM0054 perl]$ ./mssql.pl
>> > [Thu Mar 21 17:30:49 2002] mssql.pl: DBD::Sybase - can't change
>> context > to database my_database2
>>
>> Right - this comes from dbdimp.c, in the syb_db_use() function. In
>> general there should be some other errors associated with that -
>> messages from the server - something like:
>>
>> Msg 10351, Level 14, State 1
>> , Line 1
>> Server user id 4 is not a valid user in database 'excalibur'
>>
>>
>> Have you tried a simple $dbh->do('use my_database2'); to see if that
>> works?
>> > SO WHAT I HAVE DETERMINED:
>> > I am guessing that the username is not getting processed correct by
>> the > Sybase driver.
>>
>> I really don't think that this is the case. It *is* possible that this
>> is a bug in the FreeTDS libraries, though.
>>
>> Michael
>
>
>
--
Bill McClintock - EDMS App/Web Development
MCIWorldcom - Colorado Springs (GOG)
VNet:622-0054 Local:(719)265-0054
Pager:1-800-PAGEMCI PIN#1686599
EMail:[EMAIL PROTECTED]
AOLIM:bm0054