Ya, I know that you can use that to get the newest id column, but what
happens if 2 inserts happen at the same time and you grab the wrong id?

Travis

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Ferghil O'Rourke
Sent: Thursday, June 08, 2000 5:24 PM
To: [EMAIL PROTECTED]
Subject: Re: Getting just added ID column


On MS SQLServer anyway the global variable @@IDENTITY will
always give the last id inserted. I'm pretty sure that's for
the current transaction.

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Travis Reeder
Sent: Thursday, June 08, 2000 5:21 PM
To: [EMAIL PROTECTED]
Subject: Getting just added ID column


What's the best way to get the id from the identity column after you just
made an insert and ensuring that you get the correct one?  I don't want to
know about the SQL syntax, but rather, is there a way to lock the database
to make sure you get the right one?  Or is there some better way that
doesn't require locking?

Travis Reeder
Director, Internet Technologies
Xabre.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to