Home » SQL & PL/SQL » SQL & PL/SQL » missing GLOBAL keyword
missing GLOBAL keyword [message #223739] Sat, 10 March 2007 19:08 Go to next message
SUSAN1
Messages: 36
Registered: March 2007
Member
hi,
the following code get ERRPR that telling missing GLOBAL keyword, why oracle dont like temporary?

SQL> create temporary table to_delete(title varchar2, id int not null);
create temporary table to_delete(title varchar2, id int not null)
*
ERROR at line 1:
ORA-14459: missing GLOBAL keyword


SQL>
Re: missing GLOBAL keyword [message #223742 is a reply to message #223739] Sat, 10 March 2007 20:16 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
You should specify the GLOBAL keyword:
SQL> create GLOBAL temporary table to_delete(title varchar2, id int not null);

See Temporary Table Example.
Re: missing GLOBAL keyword [message #223755 is a reply to message #223742] Sun, 11 March 2007 00:58 Go to previous messageGo to next message
SUSAN1
Messages: 36
Registered: March 2007
Member


1-why there is some strenge error that tlle missin left parenthesis.
2-may I ask why Global?


SQL> create global temporary table to_delte(title varchar2, id int not null);
create global temporary table to_delte(title varchar2, id int not null)
*
ERROR at line 1:
ORA-00906: missing left parenthesis
SQL>
Re: missing GLOBAL keyword [message #223758 is a reply to message #223755] Sun, 11 March 2007 03:00 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
You have to specify a lenght for the varchar2 column. It should be for example varchar2(25) to allow for 25 characters.
Why global? Because they are called global temporary tables.
icon7.gif  Re: missing GLOBAL keyword [message #223759 is a reply to message #223739] Sun, 11 March 2007 03:17 Go to previous messageGo to next message
SUSAN1
Messages: 36
Registered: March 2007
Member
thanks
Re: missing GLOBAL keyword [message #223809 is a reply to message #223758] Sun, 11 March 2007 14:31 Go to previous message
William Robertson
Messages: 1640
Registered: August 2003
Location: London, UK
Senior Member
Frank wrote on Sun, 11 March 2007 08:00
Why global? Because they are called global temporary tables.
Smile

I think the alternative would be "local" temporary tables, which Oracle does not provide.

Although talking of mysterious keywords, I've always wondered why EXECUTE IMMEDIATE when there is no EXECUTE SOME TIME IN THE FUTURE. I think that must be a standards thing as well.
Previous Topic: file structure
Next Topic: Insufficient Privileges when creating function-based index .....
Goto Forum:
  


Current Time: Fri Dec 02 23:09:38 CST 2016

Total time taken to generate the page: 0.04844 seconds