|
|
|
Re: Create Global Temporary Table - Error [message #19888 is a reply to message #19835] |
Tue, 16 April 2002 09:41 |
André ALIMBA
Messages: 16 Registered: April 2002
|
Junior Member |
|
|
1) Before creating Temporary Table, verify allways that if this table does not exist in YOUR schema .
Example :
SELECT * FROM ALL_OBJECTS
WHERE OBJECT_NAME = 'table_tempo'
and object_type = 'TABLE';
If the table exist, drop the table or continue...
...
2) Creation of the temporary table "table_tempo" by using of DYNAMIC SQL :
...
DECLARE
var_sqlcode number;
BEGIN
EXECUTE IMMEDIATE
'BEGIN
CREATE GLOBAL TEMPORARY TABLE table_tempo
(
tab_tempo_id INTEGER NOT NULL ,
col1 DATE NOT NULL ,
col2 varchar2(5) NOT NULL ,
col3 NUMBER(12,3),
...
col_end number(12,3)
)
ON COMMIT PRESERVE ROWS'
USING IN OUT var_sqlcode;
...
|
|
|