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

Home -> Community -> Usenet -> c.d.o.tools -> ?Table_name as a procedure parameter

?Table_name as a procedure parameter

From: <WiltonD_at_state.mi.us>
Date: Fri, 01 Sep 2000 13:29:38 GMT
Message-ID: <8ooavc$gb1$1@nnrp1.deja.com>

Hi, does anyone know how to accept table and column names as arguements. I created a view from user_tab_columns so I can see the table (parameter) in the procedure but I can't update or insert because Oracle can't see the table.
The code looks something like this so far! CURSOR MYCURSOR IS
SELECT p_column_name, p_table_name| |'_REC' --primary key for all tables FROM my_view
WHERE table_name = p_table_name
AND column_name = p_column_name;

FOR record in cursor LOOP
pl/sql code to change all records

(Here's the problem)
UPDATE p_table_name set p_column_name = v_new_column WHERE p_table_name| |'_REC' = record.p_table_name| |'_REC';

ERROR p_table_name must be declared!

Any help?
Thanks
Dave

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Sep 01 2000 - 08:29:38 CDT

Original text of this message

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