B4J Question LAST_INSERT_ID() in batch commands JRDC

le_toubib

Active Member
Licensed User
Longtime User
hi all
i m tryin to get last_id from an insert statement in JRDC2
can i use this mysql function :
LAST_INSERT_ID()

INSERT INTO foo (auto,text)
VALUES(NULL,'text'); # generate ID by inserting NULL
INSERT INTO foo2 (id,text)
VALUES(LAST_INSERT_ID(),'text'); # use ID in second table

as batch commands ?

is this possible / reliable ?
is there a better way ? other than this http://stackoverflow.com/questions/13151861/fetch-last-inserted-id-form-stored-procedure-in-mysql
which i dont really understand :)
 
Top