stored procedures - Return row ID from StoredProcedure MySQL -


i attempting return value of row statement:

insert systemname (systemname) select * (select v_systemname) tmp not exists (     select * systemname systemname = v_systemname ) limit 1; set id = last_insert_id(); 

if insert need return row id, otherwise needs return new row id. tried use last_insert_id() didn't return needed because if didn't insert give wrong result. have idea make work?

http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_last-insert-id

assuming procedure expects row id , no further processing done can try: select last_insert_id();


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -