Re: Help on creating procedures on Oracle 7.2

From: Mark Styles <lambic_at_msn.com>
Date: 1997/12/03
Message-ID: <348560F5.E4_at_msn.com>#1/1


Björn Boström wrote:
> 1) How do I declare a variable in an stored procedure? (In the on-line
> help it says you can't use DECLARE as you do in triggers)

You don't have to use DECLARE, because the bit between the procedure definition and the BEGIN is implicitly the declare section, define all your variables there. E.g:

CREATE OR REPLACE PROCEDURE my_proc

    my_var varchar2(10);

BEGIN
...

> 2) Is it possible to have a trigger calling a stored procedure that
> creates a new table?? The new table should have the same name as the
> inserted value in the table that triggered the trigger.

You would have to use dynamic sql to do this, as DDL is not allowed in stored procedures. Have a read of the Application Developers Guide, which explains how to use the DBMS_SQL supplied package. Received on Wed Dec 03 1997 - 00:00:00 CET

Original text of this message