db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul J. Lucas" <pauljlu...@mac.com>
Subject Re: Atomicity of using IDENTITY_VAL_LOCAL()
Date Fri, 13 May 2005 16:49:15 GMT
On Fri, 13 May 2005, Daniel John Debrunner wrote:

> So I think the answer to Paul's question is not answered by that
> documentation.

 	Right.

> Does it mean the most recent INSERT for that connection or the most
> recent insert to the database.

 	What about the most recent insert for a table?  Does:

 		SELECT IDENTITY_VAL_LOCAL() FROM mytable1;

 	really only return IDENTITY_VAL_LOCAL() for *that* table or is
 	the above deceptively equivalent to:

 		VALUES IDENTITY_VAL_LOCAL();

 	?  More explicitly, if I do:

 		INSERT INTO mytable1 ... ;
 		INSERT INTO mytable2 ... ;
 		SELECT IDENTITY_VAL_LOCAL() FROM mytable1;
 		SELECT IDENTITY_VAL_LOCAL() FROM mytable2;

 	where both tables have an IDENTITY column, so I get the correct
 	values back from both selects?

 	- Paul

Mime
View raw message