tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siggelkow, Bill" <bill.siggel...@mirant.com>
Subject RE: SQL INSERT
Date Mon, 25 Aug 2003 13:20:29 GMT
 If you are using MySQL you can use
"SELECT LAST_INSERT_ID()" to get the id value. Just issue that query within the same transaction
after the insert.

-----Original Message-----
From: p@zdzior
To: taglibs-user@jakarta.apache.org
Sent: 8/25/03 7:52 AM
Subject: SQL INSERT

Dear Taglibs users,

I am erforming SQL insert statement using  JSTL tgalib:

   <sql:transaction dataSource="${test}">
      <sql:update var="InsertDriver">
        INSERT INTO REQUEST_OFFER (RO_FK_CUST_PHONENO, RO_TYPE
                                   VALUES (?,?)
        <sql:param value="${Customer.phone_no}"/>
        <sql:param value="SINGLE"/>
      </sql:update>
    </sql:transaction>
 
The REQUEST_OFFER table has an ID field which is autincrement unique
key.
Is it possible to obtain the value of this filed just after insert using
JSTL?
Something like getGeneratedKeys() java methd.
Or if it is impossible to do using JSTL how to do it using java
scriptlet?

thank you very much for help,

regards,
lukasz




Mime
View raw message