Create select table in Toad Data Point

Database
Highlighted

Create select table in Toad Data Point

Hello- I am knew to teradata queries and creating tables.

 

The company I work for has large tables, and i created a query in Toad Data Point. I want to now create a table from the results of that query about (about 1212) recordes.

 

I keep getting an error 3707.

I want to create the table witht he same structure and table names that I am pulling the data from, just liek a normal orcle sql create table as statement.

 

I dont know if i am not putting in the database name wrong or my userID.. Any help would be appreciated.

 

Create TABLE RZ_SCRATCH SZB628. Test as

(SELECT PO_LINE_F.CLIENT_ID,

 

PO_LINE_F.SRC_SYS_ID,

PO_LINE_F.CO_CD,

PO_LINE_F.PURCH_DOC_NBR,

PO_LINE_F.PURCH_DOC_ITEM_NBR,

PO_LINE_F.RQMT_TRK_NBR,

PO_LINE_F.GPS_PO_NBR,

PO_LINE_F.MTL_NBR

FROM FINC.PO_LINE_F PO_LINE_F

WHERE ( "PO_LINE_F"."RQMT_TRK_NBR" = '2TJR0003'

OR "PO_LINE_F"."RQMT_TRK_NBR" = '3B8Z0000')

GROUP BY PO_LINE_F.PURCH_DOC_NBR,

 

PO_LINE_F.PURCH_DOC_ITEM_NBR,

PO_LINE_F.RQMT_TRK_NBR,

PO_LINE_F.GPS_PO_NBR,

PO_LINE_F.MTL_NBR,

PO_LINE_F.CLIENT_ID,

PO_LINE_F.SRC_SYS_ID,

PO_LINE_F.CO_CD);

2 REPLIES
Teradata Employee

Re: Create select table in Toad Data Point

You can get all the SQL manuals from info.teradata.com.  The syntax for create-table is: CREATE TABLE [databasename.]tablename ..., so this should look something like "Create TABLE SZB628.RZ_SCRATCH as ...."  or  "Create TABLE SZB628.Test as ...."   Note that if databasename is omitted it will use the current default database for this session.

Teradata Employee

Re: Create select table in Toad Data Point

You are missing the required WITH [NO] DATA clause (and the recommended PRIMARY INDEX clause) between the closing parenthesis and the semicolon.