Home » SQL & PL/SQL » SQL & PL/SQL » Creating and Using Temporary Table inside pl/sql function
Creating and Using Temporary Table inside pl/sql function [message #2927] Thu, 22 August 2002 08:01 Go to next message
Lev Altman
Messages: 2
Registered: August 2002
Junior Member
When I try to create temp table inside pl/sql function - CREATE GLOBAL TEMPORARY TABLE x_temp (y VARCHAR2(256) NOT NULL ) ON COMMIT DELETE ROWS; - oracle rejects it as DDL statement not alowed in pl/sql.

If I use EXECUTE IMMEDIATE 'CREATE GLOBAL TEMPORARY TABLE x_temp (y VARCHAR2(256) NOT NULL ) ON COMMIT DELETE ROWS' to create a temp table - the temp table name x_temp is not recognisable inside the function.

It must be an easy way to create a temporary table inside pl/sql and have its name recognizable.
Re: Creating and Using Temporary Table inside pl/sql function [message #2932 is a reply to message #2927] Thu, 22 August 2002 09:41 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
As mentioned in my reply in the PL/SQL forum, you will need to use NDS for all references to that table since the object is unknown at compile time.
Previous Topic: Filtering
Next Topic: PCTUSED storage parameter
Goto Forum:
  


Current Time: Wed Apr 17 19:38:34 CDT 2024