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

Home -> Community -> Usenet -> c.d.o.misc -> insert rows into dynamically named tables within cursor

insert rows into dynamically named tables within cursor

From: <poffs_at_tteam.com>
Date: Thu, 04 Feb 1999 21:15:35 GMT
Message-ID: <79d2lb$8v7$1@nnrp1.dejanews.com>


i need to insert rows into dynamically named tables within a cursor. it doesn't like the variable that represents the tables, RESULT. It thinks RESULT is a table name. Anything I can do? Thanks in advance.

Declare
result user_objects.object_name%type;
result2 user_objects.object_name%type;

cursor c1 is
  select substr(object_name,2,5) as bbb, object_name from user_objects where object_name like 'T%';

begin

  for i in c1 loop
 result := i.object_name;
result2:=i.bbb;
insert into result(fff,ggg,hhh)
select fff,ggg,hhh
from ext_report_t
where substr(hhh,3,5) = result2;
end loop;
commit;
end;
&#137;&#137;

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Feb 04 1999 - 15:15:35 CST

Original text of this message

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