Re: Insert a return a Serial Column Value
Posted in 2004
Claus Samuelsen — — source: Usenet: comp.databases.informix
INSERT INTO scheduler (creator_ds, location_ds, start_dt )
VALUES ("testid","home","07/07/2004");SELECT dbinfo('sqlca.sqlerrd1') as id_no FROM systables WHERE tabid = 1;
Dan wrote:
> I am trying to insert a record and return a serial column named id_no
> expecting the following query to give me what I am looking for, but
> without any luck(this produces error). I need to keep this as simple
> as possible and avoid having a stored procedure. Can someone help
> edit this query or point me to a complete example.
>
> INSERT INTO scheduler
> (creator_ds, location_ds, start_dt )
> VALUES ("testid","home","07/07/2004")
> returning id_no;>
> Thanks ahead
> Dan