|
Archives of the TeradataForumMessage Posted: Thu, 11 Aug 2016 @ 11:53:02 GMT
Hi All, I need a quick solution of suffix date timestamp in exported file in Windows OS, could it be possible with Bteq script below? Will be appreciated of your prompt response!! Thanks, -Surajit ==== .OS run_date=%date% %time% .RUN FILE=@TD_LOGON@; .set width 65531 .set errorout stdout .set RETLIMIT = 2147483647,*; SEL CURRENT_TIMESTAMP; .IF ERRORCODE <> 0 THEN .QUIT ERRORCODE; /* .OS DEL C:\Test_BTQ\ESRA_BrandHrchy_%run_date%.txt */ .EXPORT FILE = C:\Test_BTQ\ESRA_BrandHrchy_%run_date%.txt .SET FORMAT OFF; SELECT '"CUEAN"'||','|| -- '"TUEAN"'||','|| '"ProductBrand"'||','|| '"ProductBrandCategory"'||','|| '"ProductBrandMarket"'||','|| '"ProductBrandSubsector"'||','|| '"ProductCorporateProductGroup"'||','|| '"ProductFormBrand"'||','|| '"ProductDivision"'||','|| '"ProductSubdivision1"'||','|| '"ProductSubdivision2"'||','|| '"ProductCategory"'||','|| '"ProductMarket"'||','|| '"ProductSector"'||','|| '"ProductSubsector"'||','|| '"ProductSegment"'||','|| '"ProductForm"'||','|| '"ProductSubform"'||','|| '"ProductSizePackFormSizePack"'( TITLE '' ) ; SELECT '"' || CUEAN ||'"'||','|| -- '"' || TUEAN ||'"'||','|| '"' || ProductBrand ||'"'||','|| '"' || ProductBrandCategory ||'"'||','|| '"' || ProductBrandMarket ||'"'||','|| '"' || ProductBrandSubsector ||'"'||','|| '"' || ProductCorporateProductGroup ||'"'||','|| '"' || ProductFormBrand ||'"'||','|| '"' || ProductDivision ||'"'||','|| '"' || ProductSubdivision1 ||'"'||','|| '"' || ProductSubdivision2 ||'"'||','|| '"' || ProductCategory ||'"'||','|| '"' || ProductMarket ||'"'||','|| '"' || ProductSector ||'"'||','|| '"' || ProductSubsector ||'"'||','|| '"' || ProductSegment ||'"'||','|| '"' || ProductForm ||'"'||','|| '"' || ProductSubform ||'"'||','|| '"' || ProductSizePackFormSizePack ||'"' ( TITLE '' ) FROM EDW_V_MT_SEMANTIC.ESRA_PROD_HIER_BKP_TST ; SELECT '"EOF"'( TITLE '' ) ; .EXPORT RESET SEL CURRENT_TIMESTAMP; .IF ERRORCODE <> 0 THEN .QUIT ERRORCODE; .LOGOFF; .QUIT;
| ||||||||||||||||||||||||||||||||||||||||||||||||
https: | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 24 Jul 2020 | ||||||||||||||||||||||||||||||||||||||||||||||||