Rexx/SQL

A Rexx interface to SQL databases

Version 2.5

10 October 2006


LITEGETINSERTID()

Returns the last unique identifier for a newly inserted row where the column is defined as INTEGER PRIMARY KEY and the value inserted into that column is NULL.

Applicable to SQLite3 databases only.

Arguments:

none
Returns:
success: the unique identifier
failure: a negative number
Example:
Call sqlconnect( 'c1', , , 'test.db' )
Call sqlcommand( 't1', 'create table table1 (pkid1 integer primary key, col1 string )'
Call sqlcommand( 't1', 'create table table2 (pkid2 integer primary key, fkid1 integer, col1 string )'
Call sqlcommand( 'i1', 'insert into table1 values( null, "string value") )'
id = litegetinsertid()
Call sqlcommand( 'i2', 'insert into table2 values( null,' id ', "string value")' )
Call sqldisconnect( 'c1' )
          

Copyright © Mark Hessling 1997-2006 <mark@rexx.org>


Return to Table of Contents
Last updated 10 October 2006