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 -> Re: truncate table in stored pl/sql proc

Re: truncate table in stored pl/sql proc

From: David Smith <skandor_at_worldnet.att.net>
Date: Mon, 10 May 1999 10:05:31 -0500
Message-ID: <7h6sfc$83k$1@bgtnsc02.worldnet.att.net>


Here's an example of how it's used.

    procedure clean_ipl is

        l_cursor integer;
        l_rtn    number;
    begin
        --
        l_cursor := dbms_sql.open_cursor;
        dbms_sql.parse(l_cursor,'truncate table
mcsa.ipl_remarks',dbms_sql.v7);
        l_rtn := dbms_sql.execute(l_cursor);
        dbms_sql.close_cursor(l_cursor);
        --
        l_cursor := dbms_sql.open_cursor;
        dbms_sql.parse(l_cursor,'truncate table mcsa.ipl_ch',dbms_sql.v7);
        l_rtn := dbms_sql.execute(l_cursor);
        dbms_sql.close_cursor(l_cursor);
        --
        l_cursor := dbms_sql.open_cursor;
        dbms_sql.parse(l_cursor,'truncate table mcsa.ipl',dbms_sql.v7);
        l_rtn := dbms_sql.execute(l_cursor);
        dbms_sql.close_cursor(l_cursor);
        --
        delete from mcsa.ipl_ei;
        commit;
        --
        delete from mcsa.ipl_hd
        where date_created is not null;
        commit;
        --

    end clean_ipl;

Big Bear wrote in message <3736EE84.2901613B_at_hotmail.com>...
>hello,
>
>could anyone out there tell me if it is possible to include truncate
>table command in a pl/sql stored procedure. i tried it but when i
>compile it gives error "expecting 'table' when expecting......"
>
>thanks & regards.
>
Received on Mon May 10 1999 - 10:05:31 CDT

Original text of this message

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