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: DML in Procedure

Re: DML in Procedure

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Fri, 1 Aug 2003 11:51:32 +0100
Message-ID: <3f2a4634$0$18496$ed9e5944@reading.news.pipex.net>


"Marc Eggenberger" <nw1_at_devnull.ch> wrote in message news:MPG.19945a2e8931430989691_at_news.cis.dfn.de...
> Hi there.
>
> I made a procedure for an import I have to do. As a requirement I have
> to create a backup of this table. So I inserted an drop table, create
> table at the beginning. But this doesnt seem to work. The procedure does
> not compile.
>
> Are such statements (DML) not valid in procedures?

Not as such. You can however use EXECUTE IMMEDIATE to run your drop and create statements.

That said I wouldn't do it that way. I'd create the backup table first (with no rows) and then just delete from the backup table and insert into it in the SP

-- 
Niall Litchfield
Oracle DBA
Audit Commission UK
Received on Fri Aug 01 2003 - 05:51:32 CDT

Original text of this message

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