Yes, this definitely works with Sybase. I've not looked at the
DBD::ODBC code, but the basic principle is that the IDENTITY_INSERT
option (like other options that you can set via the SET command) are
bound to your connection. This, with DBD::Sybase is the $dbh, and the
first $sth created from the $dbh (if you create multiple concurrent
$sth handles the additional handles have to open new connections to
the server, thus loosing the SET options).
This might be the reason why DBD::ODBC looses this information...
(btw, I'd be interested to know if anyone here is useing DBD::ODBC to
connect to a Sybase server...)
Michael
Steve Howard writes:
> If you're using MS SQL it won't work. I've been told by someone that using
> DBI, you can set IDENTITY_INSERT on and off on Sybase, but I can't confirm
> that for you.
>
> using MS SQL, you don't have any of the connection specific items like
> IDENTITY_INSERT or ANSI_NULLS or connection specific temporary tables
> available. For Temp tables, you can use global temp tables. When I need to
> set IDENTITY_INSERT on for a table, I usually use OLE and ADO (That's the
> only time I use OLE and ADO instead of DBI).
>
> Reading through Perldoc DBI I think it is due to the way DBI does not
> actually recognize a connection - at least it doesn't make a connection the
> same way constant the way MS SQL needs it to be for connection specific
> settings and temp tables.
>
> Hope someone else can prove me wrong on this one.
>
> Steve H.
>
> -----Original Message-----
> From: Pat Sheehan [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 25, 2001 9:28 AM
> To: [EMAIL PROTECTED]
> Subject: I don't seem to be able to 'SET IDENTITY_INSERT {table}
> ON'using DBI::ODBC.
>
>
> I don't seem to be able to 'SET IDENTITY_INSERT {table} ON' using DBI::ODBC.
> Anybody have suggestions?
> Many Thanks!!
>
>
--
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
[EMAIL PROTECTED] - [EMAIL PROTECTED]
International Sybase User Group - http://www.isug.com