kondakindi
IS-IT--Management
Hi,
I have a table with column names as Q_1,Q_2 0 columns till 7etc
I would like to update the table using execute immediate with values from a pl/SQl table
around for 40 lines itsays nothing then says invalid identifier for the set values
.i can't take a the fields statically that is why i am using execute update ...
i tired inserting it for 10 rows it deosn't show any error but doesn't get updated.i commit it after running the pl/sql block
the syntax for the execute immderiate is as follows:
v_element_tab is a pl/sql table which has the mentioned rows and v_row and i and val is also assigned value are declared
when i do a normal static update it works.Could u look at the code and tell me wht is wrong with it
while x <= 20
loop
for i in 1..v_element_tab(v_row).e_count
loop
dbms_output.put_line('row_count'||v_element_tab(v_row).e_count||'element is'||v_element_tab(v_row).element);
dbms_output.put_line('i count'||i);
v_col:='Q_'||x;
EXECUTE IMMEDIATE
'UPDATE REPORT1'||
' SET ' || v_col || ' ='||
v_element_tab(v_row).element ||' where seq_num ='||val;
x:=x+1;
dbms_output.put_line(v_col);
end loop;
v_row:=v_row+1;
end loop;
thanks,
I have a table with column names as Q_1,Q_2 0 columns till 7etc
I would like to update the table using execute immediate with values from a pl/SQl table
around for 40 lines itsays nothing then says invalid identifier for the set values
.i can't take a the fields statically that is why i am using execute update ...
i tired inserting it for 10 rows it deosn't show any error but doesn't get updated.i commit it after running the pl/sql block
the syntax for the execute immderiate is as follows:
v_element_tab is a pl/sql table which has the mentioned rows and v_row and i and val is also assigned value are declared
when i do a normal static update it works.Could u look at the code and tell me wht is wrong with it
while x <= 20
loop
for i in 1..v_element_tab(v_row).e_count
loop
dbms_output.put_line('row_count'||v_element_tab(v_row).e_count||'element is'||v_element_tab(v_row).element);
dbms_output.put_line('i count'||i);
v_col:='Q_'||x;
EXECUTE IMMEDIATE
'UPDATE REPORT1'||
' SET ' || v_col || ' ='||
v_element_tab(v_row).element ||' where seq_num ='||val;
x:=x+1;
dbms_output.put_line(v_col);
end loop;
v_row:=v_row+1;
end loop;
thanks,