Re: factory function that returns the same for an entire transaction

Tobias Downer <[email protected]> Thu, 17 Mar 2005 17:27:38 -0800
Newsgroups gmane.comp.db.mckoi
Message-ID <[email protected]>
Probably the easiest way to achieve this is to perform the NOWPLUS(1000) 
function on the client and set the values in the PreparedStatement for 
the insert command.  If you wish for a NOWPLUS function on the server to 
be transaction sensitive, you will need to modify the 
com.mckoi.database.QueryContext interface so that the 'time transaction 
started' property is made available to all functions.  Functions are not 
intended to have knowledge of the transaction context because it is 
sometimes necessary to evaluate an expression without a transaction context.

Toby.

Kim Schulz wrote:
> hi
> I'm working on a Factory function ( NOWPLUS(int) ) which is supposed to
> return a timestamp which is Now+XXXsec. I need the timestamp to be the
> same for an entire transaction, so if I insert 2000 rows,
> 
> INSERT INTO table (vDate, vInfo) VALUES
> (NOWPLUS(1000),'info1'),(NOWPLUS(1000),'info2'),...(NOWPLUS(1000),'info
> 2000 ');
> 
> then the "now" part of the timestamp should be the same for all (ofcause
> the sec offset should be changeable)
> 
> Does anyone have an idea on how to do this? It is no problem that I need
> to change the main system because it is allready modified in other
> places. 


---------------------------------------------------------------
Mckoi SQL Database mailing list  http://www.mckoi.com/database/
To unsubscribe, send a message to [email protected]