Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Union all to create new table trouble, "missing key word" 1

Status
Not open for further replies.

CTOROCK

Programmer
May 14, 2002
289
0
0
US
Hi I am trying to create a new table by combining 5 other tables. I can't seem to get my syntax right, although I've done it before like this. I'm using SQ:*Plus in Oracle. I get an erron on line two "missing key word". Any suggestions? Thanks in advance for any help. This is what I have:

SELECT *
INSERT INTO ALL_PRODUCT_NEW
FROM
(
SELECT *
FROM HI_PRODUCT_NEW
UNION ALL
SELECT *
FROM NW_PRODUCT_NEW
UNION ALL
SELECT *
FROM GA_PRODUCT_NEW
UNION ALL
SELECT *
FROM CO_PRODUCT_NEW
UNION ALL
SELECT *
FROM MA_PRODUCT_NEW
);


The greatest risk, is not taking one.
 
Your syntax is off. Do you care tablespace? The follow should work:

CREATE TABLE Test_Tab4
TABLESPACE TestTab_Ts
STORAGE (INITIAL 500M NEXT 50M
MAXEXTENTS UNLIMITED)
AS
SELECT *
FROM
(
SELECT *
FROM Test_Tab1
UNION ALL
SELECT *
FROM Test_Tab2
UNION ALL
SELECT *
FROM Test_Tab3
)
/
 
That did it! Thanks, here's a star!

The greatest risk, is not taking one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top