Dear experts,
most likely i'm not seeing the wood for the trees
I created a procedure thats supposed to do some currency conversion for me:
create procedure SCHEMA.CC ( in SID nvarchar(3), in MANDT nchar(3), in DATUM date, in START_CURRENCY_C nvarchar(5), in TARGET_CURRENCY_C nvarchar(5), in START_CURRENCY_V dec(15,2), in TYPE_OF_RATE char(2) default 'M', out TARGET_CURRENCY_V dec(15,2) ) LANGUAGE SQLSCRIPT SQL SECURITY INVOKER AS BEGIN -- some Variables DECLARE CT nchar(5); DECLARE BW nchar(5); DECLARE XI nchar(1); DECLARE UKURS dec(9,5); DECLARE FFACT dec(9,0); DECLARE TFACT dec(9,0); DECLARE DUMMY integer; -- Start currency and target currency match? if TARGET_CURRENCY_C = START_CURRENCY_C then TARGET_CURRENCY_V := START_CURRENCY_V; -- then ... -- ##################### -- some coding here -- ##################### -- calculation TARGET_CURRENCY_V := START_CURRENCY_V * FFACT / UKURS * TFACT; end if; END ;
Then i want to use it for updating a col in a table using something like the following code:
update SCHEMA.TABLE as T set COL_EUR = (select TARGET_CURRENCY_V from SCHEMA.CC_TMP(T."SID", T."MANDT", T."AUGDT", T."WAERS", 'EUR', T."WRBTR", 'M'))
Any help to shed some light on this issue would be highly appreciated