I have two variables 1. inserted_user_id, 2. inserted_address_id
in my MySQL procedure.
I need to use them in insert queries and select queries. Im trying something like
insert into user_new(name, company, email, customer_id) select name, company, email, inserted_user_id from user_old;
insert into user_address_map(address_id, user_id) select inserted_user_id,inserted_address_id ;
There two statements are not working. How to use procedure variable's value in the above sql statements?