Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 03 Oct 2008 @ 20:33:12 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


Subj:   Create table as "select statement"
 
From:   Oscar Valles

Good morning,

I am in the process of creating a table using the following statement:

     CREATE TABLE AP2.PRCHSUMM AS
     (
     select t.cust_id,
       concat('20', substr(rpt_dt,1,2), '-', substr(rpt_dt,3,2), '-01') as
     RPT_DT, . . .

When I execute my SQL, I receive the following error, "Syntax error: expected something between '(' and the string '2'."

Even if I cast my concat function as a date

     select t. cust_id,
       cast (concat('20', substr(rpt_dt,1,2), '-', substr(rpt_dt,3,2), '-01')
     as DATE FORMAT 'YYYY-MM-DD') as RPT_DT,

I receive the error: "expected something like "||" between the word 'concat' and '('"

Does a technique exist where I can place concatenated data into a database via the create-table-as-select statement?


Thank you for your time.

Oscar V.



     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016