Home » SQL & PL/SQL » SQL & PL/SQL » Global temp table throwing error (ORACLE 10 G)
Global temp table throwing error [message #387995] Mon, 23 February 2009 00:02 Go to next message
rangan.s
Messages: 75
Registered: February 2008
Location: chennai
Member
Hi,

I am trying to create global temp table throwing error
please help


SQL> create global temporary table test_glb as ( select col1 from test1) on commit delete rows;

create global temporary table test_glb as ( select col1 from test1) on commit delete rows

ORA-00933: SQL command not properly ended


Thanks
Rangan S
Re: Global temp table throwing error [message #388005 is a reply to message #387995] Mon, 23 February 2009 00:27 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
How do you learn how to code? It appears that you tried a statement, it failed, and you came over here to ask for help. Wouldn't you rather study the documentation which will help you produce syntax-error-free statements?
Re: Global temp table throwing error [message #388013 is a reply to message #387995] Mon, 23 February 2009 00:36 Go to previous messageGo to next message
rangan.s
Messages: 75
Registered: February 2008
Location: chennai
Member
I know how to code . I am posted here for an issue . the oracle is not allowing these scenario.


Re: Global temp table throwing error [message #388018 is a reply to message #388013] Mon, 23 February 2009 00:41 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
No, it is not "an issue" - you did not follow the CREATE TABLE syntax and got an error.

Believe or not, it is possible to create a global temporary table using the CTAS (Create Table AS) statement, only if you know how to properly do that. In order to learn how to properly do that, please, read the documentation.
Re: Global temp table throwing error [message #388019 is a reply to message #387995] Mon, 23 February 2009 00:43 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
If you correctly followed the guidelines you'd know the reason:
1/ Execution
SQL> create global temporary table test_glb as ( select col1 from test1) on commit delete rows;
create global temporary table test_glb as ( select col1 from test1) on commit delete rows
                                                                    *
ERROR at line 1:
ORA-00933: SQL command not properly ended

The error is on "ON" => go to documentation => Doh! I didn't properly used CREATE TABLE statement.

=> No need of a forum
=> I can do it myself
=> Faster answer
=> I learn something from the doc. much more than the correct syntax to create a temporary table

Regards
Michel
Re: Global temp table throwing error [message #388133 is a reply to message #388018] Mon, 23 February 2009 06:56 Go to previous messageGo to next message
rangan.s
Messages: 75
Registered: February 2008
Location: chennai
Member
under stand how to get this ?

dont simply say like refer documnets that we know

CREATE GLOBAL TEMPORARY TABLE test_glb ON COMMIT DELETE ROWS
AS SELECT * FROM test1;



Thanks
Rangan S
Re: Global temp table throwing error [message #388145 is a reply to message #388133] Mon, 23 February 2009 07:47 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
rangan.s wrote on Mon, 23 February 2009 07:56
under stand how to get this ?

dont simply say like refer documnets that we know



What are you trying to say here? I think you are asking not to be referred to the documentation because you know how to do it, but you have shown that you did not know how to do it.
Previous Topic: exracting huge data from remote database
Next Topic: ORA-01843: not a valid month
Goto Forum:
  


Current Time: Tue Feb 11 14:53:53 CST 2025