Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> PL/SQL cursor for loop (trying to update another table)

PL/SQL cursor for loop (trying to update another table)

From: Andersen Consultant <Jim_Fanning_at_WMG.COM>
Date: Thu, 18 Jan 1996 14:31:18 EST
Message-Id: <9601182311.AA01938@alice.jcc.com>


Hello again.
Different question, but perhaps more pressing. I have a table with 3 columns: Tablename, columnname, and value. In a PL/SQL procedure, I have a cursor (tab_cur) which selects tablename, columnname, and value from this table. (Tablename and columnname refer to actual tables and columns in my database) I then have a cursor FOR loop in which I have the following SQL code:
Update tab_rec.tablename
Set tab_rec.columnname = tab_rec.value; When I try to compile the procedure, I get the following error: tab_rec.tablename must name a table to which the user has access. I have privileges on all of the tables, and when I change the code and hard-code the names of tables and columns, it compiles fine. I even tried setting up temporary variables and setting them equal to the cursor variables, then using the new variables in the Update, but that doesn't work either. If anyone has done this before, or has an idea and wants to see the actual code, please e-mail me back. Thanks - Jim Fanning Received on Thu Jan 18 1996 - 18:11:16 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US