I am trying to use an update statement in a cursor but values like the table name (and column names) are changing with every record fetched from the cursor. I am storing the table name and column names in a table and use these as parameters for the update statement. With each loop through the cursor, I am initializing a variable with the update statement.
My question is, how do I execute an update statement which is stored in a variable. I want to execute the update statement with each loop in the cursor.
Thanks.
I have been initializing a variable with the update statement.
lv_update_statement := ‘update scpomgr.’|| lv_table_name || ‘ set ‘ || lv_param_name || ‘ = ‘ || lv_param_value || ‘ where item = ‘ || lv_item || ‘ and loc = ‘ || lv_loc || ‘;’;
Williamv is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.