in jsp by using JSTL , how i can get inserted id -


When I execute the query, I can get the id by call mysql_insert_id () function for this query

 ID name ------------- 1 jack2s Sarah 

>

  & lt; Sql: updated data source = "$ {snapshot}" var = "results" & gt; Include user (name) values ​​(INSERT); & Lt; Sql: Ultimate value = "$ {name}" /> & Lt; / SQL: Update & gt;  

If I execute this query, then I hope to have ID number 3. But how do I get it?

You can use the updated update and query in sql: Transaction Tags:

  & lt; Sql: transaction data source = "$ {snapshot}" & gt; & Lt; Sql: update var = "results" & gt; Include user (name) values ​​(INSERT); & Lt; Sql: Ultimate value = "$ {name}" /> & Lt; / SQL: Update & gt; & Lt; Sql: query var = "nextIdTable" & gt; Select LastId as LAST_INSERT_ID () & lt; / Sql: Query & gt; & Lt; / SQL: Transactions & gt; Value is: $ {nextIdTable.rows [0] .lastId}  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -