on 2016 Mar 13 6:31 PM
Hi ,
Inside a procedure, I use a table variable to store the some result from table A .
I have to use this table variable in dynamic sql .
Eg)
Call Procedure A()
Begin
VAR_TAB = select customer_id from table_A;
EXEC ' select * from'||: var_tab;
End;
The above code will throw error. Anyone has a solution for this ?
Thanks,
Yogesh
Hello Yogesh,
as mentioned in the SQLScript Reference (Dynamic SQL - SAP HANA SQLScript Reference - SAP Library) it is not possible to address SQLScript variables in a dynamic SQL statement. If really necessary you could exchange information between the SQLScript and the dynamic SQL via local temporary tables. But of course you should avoid dynamic SQL if possible due to the big disadvantages.
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
67 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.