I have insert query that works, but I can't get ID of created row in return. How can I achieve that? having this:
conn = Java::JavaSql::DriverManager.getConnection(url)
st = conn.create_statement
rs = st.execute_update(query)
How can I get id?
I have insert query that works, but I can't get ID of created row in return. How can I achieve that? having this:
conn = Java::JavaSql::DriverManager.getConnection(url)
st = conn.create_statement
rs = st.execute_update(query)
How can I get id?
more of a JDBC question that depends on the DB/driver used.
generally st.generated_keys
gives you a result set of the IDs
also read: How to get the insert ID in JDBC?