MySQL - multi-statement query
Posted: 23.06.2010, 05:47
Hi,
Just wonder if I can put multi-SQL into the TZQuery?
I want to insert a record then fetch the last insert ID of the auto-incremented field.
eg.
BEGIN TREANSACTION;
INSERT INTO table1(empID, empName)
VALUES ('1234', 'John Smith');
SELECT LAST_INSERT_ID() As newID;
COMMIT;
do I call query1.Open or query1.ExecSQL?
Just wonder if I can put multi-SQL into the TZQuery?
I want to insert a record then fetch the last insert ID of the auto-incremented field.
eg.
BEGIN TREANSACTION;
INSERT INTO table1(empID, empName)
VALUES ('1234', 'John Smith');
SELECT LAST_INSERT_ID() As newID;
COMMIT;
do I call query1.Open or query1.ExecSQL?