+-------+------------------+-----+-----------------+
| Field | Type | Key | Extra |
+-------+------------------+-----+-----------------+
| id | int(10) unsigned | PRI | auto_increment |
| name | varchar(15) | | |
+-------+------------------+-----+-----------------+
//this returns just 0 or 1, but it would be nice to get actual id
//is it possible?
var id: integer;
.
.
id:=Statement.ExecuteUpdate('INSERT INTO table(name) VALUES "name")');
At moment I insert something first and then serch (select) it to get id.
Actually, I think you better do a 'SELECT LAST_INSERT_ID()' query after the update call. Because of it's simpicity and because using the TZSequence would become a components-based solution, while here the dbc approach is used.
BEGIN
INSERT INTO table_profession_rubric (key_profession, key_rubric)
VALUES (:arg_key_profession, :arg_key_rubric);
SELECT LAST_INSERT_ID() AS 'out_id';
END
doesn't work as expected. Is it possible not use 2 ZQueries? I'm not sure whether "SELECT LAST_INSERT_ID()" is specific to connection or to something else. I'd like to keep it near the INSERT.