1

There are two different methods for inserting a row into table:

  • execSql, using it I can execute sql statements with SELECT - INSERT. But it doesn't return id of new row.
  • different inserts - I can get insert-id here, but I can't create insert queries with substitution values from another table.

I can split my query into two, but isn't it slower, than one query?

loginpassword
  • 307
  • 1
  • 5
  • 14
  • If you need to substitute values in one table by values from another I would consider creating TRIGGERS in database. – slkorolev Oct 30 '11 at 18:30

1 Answers1

2

Do your insert however you like, then execSql "select last_insert_rowid()".

JimmyB
  • 12,101
  • 2
  • 28
  • 44