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

Home -> Community -> Usenet -> c.d.o.server -> pl/sql error utilizing dynamic sql

pl/sql error utilizing dynamic sql

From: Stephen <poffs_at_tteam.com>
Date: Tue, 9 Feb 1999 17:43:38 -0500
Message-ID: <79qdhs$gpa@tuna.eky.com>


am getting error on the below code.

here are the errors:

pls-00201 identifier 'dbms_sql.open_cursor' must be declared pls-00201 identifier 'dbms_sql.execute' must be declared

code:

procedure itable_proc
AS

    begin
    declare
    vname varchar2(8);
   RESULT suser_t.mailerplanetcode%type;    RESULT2 suser_t.mailerplanetcode%type;    cursor c1 is
    select mailerplanetcode as plcde, mailerplanetcode from      suser_t;
   procedure execute_immediate( sql_stmt in varchar2 )    as

     exec_cursor     integer default dbms_sql.open_cursor;
     rows_processed  number  default 0;
   begin
     dbms_sql.parse(exec_cursor, sql_stmt, dbms_sql.native );
     rows_processed := dbms_sql.execute(exec_cursor);
     dbms_sql.close_cursor( exec_cursor );
      end;

    begin
   for i in c1 loop
     RESULT := i.plcde;
     vname := 'T'||RESULT||'_T';
     RESULT2 := i.mailerplanetcode;
     execute_immediate( 'insert into ' || vname || '

 scf,postal_oper_num,read_date,planetcode,postnet_zipcode,table_date)
                         select
scf,postal_oper_num,read_date,planetcode,postnet_zipcode,sysdate
                           from ext_report_t
                          where substr(planetcode,3,5) = ''' || RESULT2  ||
''''
                      );

   end loop;
    end;
 end itable_proc;

--

Stephen E. Poff
poffs_at_tteam.com Received on Tue Feb 09 1999 - 16:43:38 CST

Original text of this message

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