Skip to Content
0
Former Member
May 05, 2016 at 11:23 PM

syntax error for dynamic column for update query

432 Views

Hi Experts,

Please check following query. i have incorporated it in my store procedure.

EXEC 'update TBL_M set '||:COL_NAME||' = '||:R."W_QTY"||'where WID ='||:R."W1";

i am getting following error.

Could not execute 'call USP_CW' in 131 ms 107 µs .

SAP DBTech JDBC: [257]: sql syntax error:--: line 29 col 5 (at pos 625): [257] (range 3) sql syntax error exception: sql syntax error: incorrect syntax near "W1": line 1 col 44 (at pos 44)

could you please let me know, where i am doing wrong.