var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Update using Dynamic SQL and generated column names
I have a cursor that produces a large amount of data with the below metadata -
The objective is to produce a dynamic update statement like this -
KEY_COL TGT_COL TGT_VAL
The TGT_COL could be any of the 50 columns in the ABC_TABLE.
Currently, I'm looping through the cursor -
But this is taking a very long time to execute. Is there a way I can better code this to make it run faster?
FOR i IN cur_Dynamic
vSql:='UPDATE ABC_TABLE SET '||i.TGT_COL||'='||CHR(39)||i.TGT_VAL||CHR(39)||' WHERE Key='||i.KEY_COL;
EXECUTE IMMEDIATE vSql;
Tags for this Thread