Last Identity added

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Carlos San Miguel

    Last Identity added

    Hi, I'm going to be using Oracle with a customer. I will access
    Informix with ODBC. All the tables have a serial column, this is the
    ID for the record. I need to know how I can get the value of the
    serial column for the last record inserted. A stored procedure maybe?

    TIA
    Carlos San Miguel
  • sybrandb@yahoo.com

    #2
    Re: Last Identity added

    yatuchabe@hotma il.com (Carlos San Miguel) wrote in message news:<b5abf2cd. 0406031659.7e18 ed17@posting.go ogle.com>...
    Hi, I'm going to be using Oracle with a customer. I will access
    Informix with ODBC. All the tables have a serial column, this is the
    ID for the record. I need to know how I can get the value of the
    serial column for the last record inserted. A stored procedure maybe?
    >
    TIA
    Carlos San Miguel
    You could use the 'returning <column_namecla use' of the insert
    statement, if you run the insert inside a stored procedure.
    If you are using sequences for the id column (which you should do),
    you could have a stored procedure running
    select <sequence>.curr val from dual;
    only.

    Sybrand Bakker
    Senior Oracle DBA

    Comment

    Working...