|
Archives of the TeradataForumMessage Posted: Tue, 14 Oct 2003 @ 13:25:26 GMT
Can you just use a derived table as a workaround, instead of creating a new one? Such as INSERT INTO DATABASE.TABLE1 SELECT STRTEXT||CSUMTEXT FROM (SELECT CASE WHEN STATEMENT END "STRTEXT", CSUM(1,VALUE) "CSUMTEXT" FROM TABLE2); It seems like you're just formatting the date to a fixed width character field So you could just do SELECT DATE (FORMAT 'YYYYMMDD')(CHAR(8)) "DATE"; And it would produce 20031014 Hope this helps, or at least starts you on the right path. INSERT INTO dss_tables.expense_current_tbl_TEST SELECT ('S'|| trim(extract(year from '2003/10/10'))|| (CASE WHEN extract(month from '2003/10/10') < 10 THEN '0'||trim(extract(month from '2003/10/10')) ELSE trim(extract(month from '2003/10/10')) END)|| (CASE WHEN extract(day from '2003/10/10') < 10 THEN '0'||trim(extract(day from '2003/10/10')) ELSE trim(extract(day from '2003/10/10')) END)|| trim(csum(1,d.date_invoice))
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||