Home » SQL & PL/SQL » SQL & PL/SQL » Create table in stored procedure
Create table in stored procedure [message #350] Wed, 06 February 2002 09:46 Go to next message
LI810
Messages: 25
Registered: February 2002
Junior Member
Please help. What is wrong with this statements. When I try to create proc, I got an error message , saying, that "create" is used in a wrong space. Expecting "declare", "begin" etc.

CREATE OR REPLACE PROCEDURE test1
is

begin

CREATE TABLE temptable

(tbl_name varchar2(50),
rowcount number(12));

INSERT INTO temptable
select tbl_nme_x as Table_name,avg(row_count)as AVG_count
from CSCADMIN.TABLE_REC_AUDIT
group by tbl_nme_x;

end;
Re: Create table in stored procedure [message #355 is a reply to message #350] Wed, 06 February 2002 13:32 Go to previous messageGo to next message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
why dont u use global temporary tables?.
Re: Create table in stored procedure [message #358 is a reply to message #350] Wed, 06 February 2002 20:42 Go to previous message
Abul Fazal
Messages: 39
Registered: February 2002
Member
DDL Statement is the Problem in the Procedure. Try with DBMS_SQL to create a Procedure that can Create a Table.
Previous Topic: Re: redundant indexes
Next Topic: vsize function
Goto Forum:
  


Current Time: Sun Sep 19 13:01:33 CDT 2021