Brandon, Nicholas (UK) wrote:
When enclosed in a single transaction, would inserting many rows into a
table using the special default keyword 'CURRENT_TIMESTAMP' result in
all of the rows guaranteeing the same timestamp value?

If not, is there a recommended way to assign a unique value to a
collection of inserts in a single transaction generated from a trigger?


Brandon,

I don't think there is a recommended way, but something like this should work:

   begin;
   create temp table time as select julianday('now') as current;
   insert into tab1 values ((select current from time), ...);
   insert into tab2 values ((select current from time), ...);
   drop temp table time;
   commit;

Basically you need to store the timestamp you want to use for all the inserts in the transaction for the length of the transaction. The only good place to store things in sqlite is in a table.

HTH
Dennis Cote

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to