Create a temporary table in stored proc
451947Aug 31 2005 — edited Oct 14 2005I'm an Oracle newb, so please forgive my ignorance.
Is it possible to create a temporarty table inside of a stored procedure?
I tried the following, but Oracle gives me an error when I try to compile it:
/***********************************************************/
CREATE OR REPLACE PROCEDURE TESTFUNC AS
BEGIN
create global temporary table gtt
(
CIM_PK VARCHAR2 (36),
SGS_CIRCUIT VARCHAR2 (24),
SGS_CIRCUIT_MEMBER VARCHAR2 (12),
POWERFACTOR float,
SUMMERRATING NUMBER (10),
WINTERRATING NUMBER (10),
ASSET_TYPE CHAR (7),
BARCODE VARCHAR2 (0),
NULL_FLD VARCHAR2 (0)
);
END TESTFUNC;
/
/************************************************************/
The error I get is:
PLS-00103: Encountered the symbol "CREATE" when expecting one of the following:
begin case declare exit for goto if loop mod null pragma
raise return select update while with <an identifier>