Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

calling sub procedure in main procedure but intended values are not capturing by subprocedure

$
0
0

The below main procedure executed successfully. The  sub procedure  ins_msg_proc(:v_msg) which has called in this procedure should insert v _prod name(product_name) values into message_box table through procedure ins_msg_proc(:v_msg),however the values from (:v_msg) are not getting insert into mesage_box table Please let me know if any idea why this is not happening, ideally it should happen, dont know if I am missing anything here..

 

create procedure orchprocProd language sqlscript --reads  sql data

as

begin

  declare v_prodid integer ;

  declare v_prodname varchar(100);

  declare v_price decimal;

  declare v_msg varchar(300);

declare cursor c_prod

   for    

        select product_id,product_name,price  

                from product_details order by product_id;

 

open c_prod;

 

fetch c_prod into v_prodid,v_prodname,v_price; 

 

v_msg := :v_prodname;

 

call ins_msg_proc(:v_msg);

 

close c_prod ;

end;

 

  --------------ins_msg_proc() ------------------

create table message_box(p_msg varchar(200),

                                            tstamp TIMESTAMP);

 

create procedure ins_msg_proc(p_msg varchar(200)) language sqlscript

as

begin

insert into message_box values(:p_msg,current_timestamp);

end;

 

----------------------------------------------------------

 

select * from message_box call ins_msg_proc(2); ---this value is getting inserted into message table while executing procedure


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>