Link to home
Start Free TrialLog in
Avatar of kevbob650
kevbob650Flag for United States of America

asked on

Oracle Error - Missing Global Keyword

I have a create temporary table command in Oracle that has worked in the past but now I'm getting the following error:

SQL Error: ORA-14459: missing GLOBAL keyword
14459. 00000 -  "missing GLOBAL keyword"
*Cause:    keyword GLOBAL is missing while creating temporary table.
*Action:   supply keyword.

I am not an admin on the database, just a user with read only priviledges

Sql looks like this:
DROP TABLE IF EXISTS t1

CREATE TEMPORARY TABLE t1(
SELECT DATE(a.thedate) AS thedate, etc. etc.)

Thanks for any assistance!
Avatar of Sean Stuber
Sean Stuber

your sql looks like sql server syntax

try something like this

CREATE GLOBAL TEMPORARY TABLE t1 as
 SELECT trunc(a.thedate) AS thedate, etc. etc.


if you have read only privileges though, you won't be able to create a temp table.
also, if you are coming from sql server,  check with your dba about creating the table for you.

In oracle,  creating and dropping temp tables is NOT a good way to work with temporary result sets.
Avatar of kevbob650

ASKER

Thanks for the quick response. I'm confused, this query has worked just fine for the past few months?  What would be the correct way to work with some temporary results that I can query against?
ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for your time! I appreciate it.