Bill McClintock writes:
> 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...
Yep.
> 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.
I think it's at the protocol level (i.e. FreeTDS or possibly at the
database server level).
I'm surprised that you can create a database (or any object) with a
'-' in it, as that symbol is (or should be) reserved.
In any case this is not something that DBD::Sybase does itself - as
you can see in one instance the '-' does get passed through, and
DBD::Sybase certainly takes all the characters for the database name
up to the end of the string or a ';' character.
You may be able to get around this with quoted identifier
functionality turned on, but you'd have to set this in the connect()
call itself, and setting quoted_identifier via the protocol call (as
happens when you set syb_quoted_identifier to 1) does not work via
FreeTDS.
You may be able to use the following work around:
$dbh = DBI->connect('dbi:Sybase:server=...', user, pwd);
$dbh->do("set quoted_identifier on");
$dbh->do("use database \"staffplan-2002\"");
.... now do the rest of your work...
Michael
--
Michael Peppler Data Migrations, Inc.
[EMAIL PROTECTED] *or* [EMAIL PROTECTED]
http://www.mbay.net/~mpeppler
International Sybase User Group: http://www.isug.com