mysql - LAST_INSERT_ID remain same without increment -


i have 3 tables named fullview,dimtab , facttab.i want insert data fullview other 2 tables using stored procedure.primary key of dimtab table should insert column value facttab table.i have tried below procedure rows of foreign key remained same without increment.highly appreciate help.

table structure

delimiter // create procedure tranxdata6() begin declare out_param integer; insert dimtab (itm_no,itm_type) select itm_no,itm_type  fullview;  set out_param = last_insert_id() ; insert facttab (id,name,company,itm_key) select f.id,f.name,f.company,out_param fullview f; end // delimiter ; 

output


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -