in reply to Getting identity after autoincr in FreeTDS/MSSQL/DBI

What is the definition of the sctemp table?

Also, run your script with the DBI->trace(3) flag, to see what DBD::Sybase thinks it's getting. For example, when I ran your script against a Sybase 12.0 server, I got:

-> fetchrow_hashref in DBD::_::st for DBD::Sybase::st (DBI::st=HAS +H(0x81c6114)~0x8106cb0) 2 -> fetch for DBD::Sybase::st (DBI::st=HASH(0x8106cb0)~INNER) dbih_setup_fbav for 1 fields => 0x8106d64 2 <- fetch= [ '26' ] row1 at scratch.pl line 22 2 -> FETCH for DBD::Sybase::st (DBI::st=HASH(0x8106cb0)~INNER 'NAME' +) 2 <- FETCH= [ 'foo' ] at scratch.pl line 22 <- fetchrow_hashref= HASH(0x8106db8)1keys row1 at scratch.pl line +22
Michael

Replies are listed 'Best First'.
Re: Re: Getting identity after autoincr in FreeTDS/MSSQL/DBI
by scain (Curate) on Nov 10, 2001 at 00:06 UTC
    Michael,

    First, welcome! I didn't know you were here. Also, thanks for answering on the FreeTDS mailing list; I didn't think there was much overlap between here and there.

    I ran with trace on and got the following results, which indicate to me that truncation is taking place somewhere. Time to spend the afternoon installing a newer version of FreeTDS.

    -> fetchrow_hashref in DBD::_::st for DBD::Sybase::st (DBI::st=HAS +H(0x81d9a58)~0x81d99c8) 2 -> fetch for DBD::Sybase::st (DBI::st=HASH(0x81d99c8)~INNER) dbih_setup_fbav for 1 fields => 0x81d9b84 2 <- fetch= [ '2' ] row1 at test3.pl line 23 2 -> FETCH for DBD::Sybase::st (DBI::st=HASH(0x81d99c8)~INNER 'NAME' +) 2 <- FETCH= [ 'foo' ] at test3.pl line 23 <- fetchrow_hashref= HASH(0x80fd484)1keys row1 at test3.pl line 23 -> errstr in DBD::_::common for DBD::Sybase::st (DBI::st=HASH(0x81 +d9a58)~0x81d99c8) <- errstr= undef at test3.pl line 25
    Thanks again,
    Scott
      Yeah, the returned data is clearly getting truncated.

      I don't think that it's specific to the @@identity value - it's probably related to numeric data getting truncated by FreeTDS.

      Michael