mysql returning more than one row -


i have mysql query needs return supplier id supplier table searching supplier name keeps returning multiple values.

create definer=`root`@`%` procedure `sp_insert_sup_order`( supname varchar(50), dat date, total decimal(10,2) ) begin insert supplier_order ( supplier_id, supdate, total, sup_name ) values ( (select supplier_id supplier supplier_id.supname =  supname ), dat, total, supname ); 

thats query. appreciated

(select supplier_id supplier supplier_id.supname =  supname ) 

this should this:

(select supplier_id supplier supplier.supname =  supname ), 

and why store supplier name , id in order ? should not done, image have change name of supplier, have update orders. supplier id should stored in order table!


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -