Hi everyone,
I need to load a column that is a concatenation from two fields of a file. One field is a date other is time type. I would like to load both resulting in a timestamp field but i wanted to do it during the tpt load. Is it possible? How can i concatenate two fields in the insert statetment?
The ideia is shown in the script below , the fourth column is a the concatenation from the third and the second column.
DEFINE JOB TSTHEX
DESCRIPTION 'TESTA CARACTERE DELIMITADOR PARA CARGA'
(
INCLUDE 'ze_tpt.sch'
STEP Tst_Delm (
APPLY 'INSERT INTO DHPVP2IT_W.TESTE_TPT_ZE
( COD_CHTA_PRSO_FUNL
,HOR_PRSO_FUNL
,DAT_PRSO_FUNL
,DAT_HOR_PRSO_FUNL )
VALUES
( :COD_CHTA_PRSO_FUNL,
:HOR_PRSO_FUNL (TIME, FORMAT''HH:MI:SS'') ,
:DAT_PRSO_FUNL (DATE, FORMAT''YYYY-MM-DD'') ,
:DAT_PRSO_FUNL||:HOR_PRSO_FUNL (TIMESTAMP(0), FORMAT''YYYY-MM-DDBHH:MI:SS'') );'
TO OPERATOR ( $LOAD()[1] )
SELECT * FROM OPERATOR ( $FILE_READER(TAB_TPT)[1] );
);
);
Forums: