Home » SQL & PL/SQL » SQL & PL/SQL » n number of CREATE statements in single procedure
n number of CREATE statements in single procedure [message #188664] Mon, 21 August 2006 02:55 Go to next message
raza_oca
Messages: 10
Registered: August 2005
Location: india
Junior Member
Hi,
I have around 24 create statements where in i'm trying to take is in single procedure will it be possible for me to call those statements in single Execute immediate statement:

for example

create or replace procedure CAT_IDX
AS
V_one varchar2(50):= 'CREATE BITMAP INDEX IDX_STT3 ON S_TRANSACTION_TRIPTOTAL
(IRI_WEEK_KEY)
TABLESPACE SITEST_IDX compute statistics;';
V_secound varchar2(50):= 'CREATE BITMAP INDEX IDX_STT3 ON S_TRANSACTION_TRIPTOTAL
(IRI_WEEK_KEY)
TABLESPACE SITEST_IDX compute statistics;';
V_three varchar2(50):= 'CREATE BITMAP INDEX IDX_STT3 ON S_TRANSACTION_TRIPTOTAL
(IRI_WEEK_KEY)
TABLESPACE SITEST_IDX compute statistics;';

begin

Execute immediate 'V_one,V_secound,V_three'
end;
/


Will this work if not please guide me. Thank you.

Waiting for your replay
Re: n number of CREATE statements in single procedure [message #188670 is a reply to message #188664] Mon, 21 August 2006 03:08 Go to previous messageGo to next message
Frank Naude
Messages: 4502
Registered: April 1998
Senior Member
No, it will not work (can't you test it yourself?)

Lookup the CREATE SCHEMA statement in the SQL reference guide.
Re: n number of CREATE statements in single procedure [message #188679 is a reply to message #188670] Mon, 21 August 2006 03:24 Go to previous messageGo to next message
raza_oca
Messages: 10
Registered: August 2005
Location: india
Junior Member
Sorry,
I'm not able to relate it please send me some sample. Thank you
Re: n number of CREATE statements in single procedure [message #188682 is a reply to message #188679] Mon, 21 August 2006 03:31 Go to previous messageGo to next message
Frank Naude
Messages: 4502
Registered: April 1998
Senior Member
There is a good example in the SQL reference guide. Just look it up.
Re: n number of CREATE statements in single procedure [message #188693 is a reply to message #188679] Mon, 21 August 2006 04:19 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
CREATE SCHEMA

Use the CREATE SCHEMA to create multiple tables and views and perform multiple grants in a single transaction.

It's just what you're looking for.
You've got the link - what else do you need?
Previous Topic: How do I...?
Next Topic: calling a function from a proc
Goto Forum:
  


Current Time: Sun Dec 04 18:35:25 CST 2016

Total time taken to generate the page: 0.10215 seconds