Results 1 to 4 of 4
  1.    #1  
    Is there a quick way of returning an auto incremented ID primary key value after a record has been inserted ? In pure Oracle SQL I'd use a sequence and get the key first.

    Do I have to write another select statement to pull back the row I just inserted to get the ID ?

    Is anything returned from an SQL insert command ? Just need to get the ID so that I can populate a child table.

    I know I can do a select but trying to determine if there is a quicker way.
  2. jsabo's Avatar
    Posts
    427 Posts
    Global Posts
    479 Global Posts
    #2  
    select last_insert_rowid(); is what I found online.

    Nabble - SQLite - how to get last autoincrement value?
  3.    #3  
    Guess this answers my question.

    The success handler is passed the transaction object plus an SQLResultSet object as an argument, with details on the attributes below.

    insertID Row ID of the row that was inserted into the database, or the last of multiple rows, if any rows were inserted

    RowsAffected Number of rows affected by the SQL statement

    SQLResultSetRowList Rows returned from query, if any
  4. #4  
    use insertId instead insertID (d is small case)

    var lastid = result.insertId;

Posting Permissions