on 11-04-2015 6:16 AM
Hi Experts,
I am trying to insert some data into table using exec or execute immediate in procedures, though procedure is created, data is not getting inserted into the desired table.
Also i want to capture the return code after the statement executed. Please help me out.
Below is the code which i am trying.
create procedure "ABC"."EFG"
AS
BEGIN
declare str varchar(500);
declare v_stmt varchar(10);
v_matnr := '123456';
str := 'insert into "SCHE"."ZTEST_TABLE" values (' ||V_MATNR|| ')';
v_stmt := EXEC (:STR);
END;
Thanks,
Ebinezar
Hello Ebinezar,
there are several issues in your procedure which avoids the creation of your procedure:
Lower/Upper cases for variables do not matter.
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Ebinezar,
did you try the variable name with the same case.,.. since you declared it with small letters, then you should use it with small letters .. v_matnr in both declaration and also in the insert dynamic statement
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.