Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2007
    Posts
    2

    Unanswered: getting serial number after insert

    Hi

    I new to informix, but i trying to get serial number after performing an insert statement.

    Thanks

  2. #2
    Join Date
    Aug 2006
    Location
    The Netherlands
    Posts
    248
    Hi, within one session you can do the insert and retrieve the last inserted serial value with:
    Code:
    INSERT INTO serialtest VALUES(0, 'Mickey', 'Mouse');     
    SELECT DISTINCT dbinfo('sqlca.sqlerrd1') FROM serialtest;
    Regards

  3. #3
    Join Date
    Sep 2007
    Posts
    2

    Getting serial number after insert

    Thanks

    I am sure it works the same way as this one, SELECT DBINFO('SQLCA.SQLERRD1') as serialid FROM systables WHERE tabname = 'mytablename'

    Thanks again for the reply i really appreciate it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •