Everything depends on the database you use.Originally Posted by pinktroll
http://doc.trolltech.com/4.1/sql-dri...cedure-support
I don't use MySQL, but in PostgreSQL you can do it like this:Originally Posted by pinktroll
SQL Code:
INSERT ...; SELECT currval( 'sequence_name' );To copy to clipboard, switch view to plain text mode
Maybe MySQL has a similar method, for example using @variables?
Anyway creating stored procedures for common queries might reduce the number of mistakes and increase performance.
Bookmarks