|
|
Archives of the TeradataForum
Message Posted: Tue, 22 May 2012 @ 16:26:29 GMT
Subj: | | Re: TPT Exporter operator usage for pipe delimeter file. |
|
From: | | Alves, Patrick |
If you want a pipe as delimiter you need to :
-Create a producer (here TYPE EXPORT)
And then a consumer (TYPE DATA CONNECTOR)
You don't have to put the delimeter in the select statement , it's in the property of the data connector :
Ckeck the next sample ( TPT 13.10) :
----------------------------------
USING CHARACTER SET ASCII
DEFINE JOB exp_N_AGG_AGGVTE_REFPETTPJOU
DESCRIPTION 'export de la tab O_AGG_AGGVTE_REFPETTPJOU'
(
DEFINE SCHEMA SCHEMA_REFPETTPJOU (
NUM_BU VARCHAR(5) ,
NUM_TYPETT VARCHAR(5) ,
NUM_ETT VARCHAR(6) ,
DAT_VTE VARCHAR(10) ,
NUM_CEN VARCHAR(6) ,
NUM_ART VARCHAR(20) ,
COD_REM VARCHAR(11) ,
QTE_VTE VARCHAR(13) ,
MNT_NET VARCHAR(14) ,
MNT_HT VARCHAR(14) ,
MNT_MRG VARCHAR(14) ,
MNT_REM VARCHAR(14) ,
COD_DEV VARCHAR(3) ,
DAT_CRE VARCHAR(20) ,
DAT_MAJ VARCHAR(20)
);
DEFINE OPERATOR EXPORT_OPERATOR
TYPE EXPORT
SCHEMA SCHEMA_REFPETTPJOU
ATTRIBUTES (
UserName = 'dbc',
UserPassword = 'dbc',
TdpId = '192.168.176.128'
,MaxSessions= 2
,MinSessions= 2
/* ,QueryBandSessInfo='UtilityDataSize=Large;' */
,SpoolMode='NoSpool'
, SelectStmt = 'SELECT
trim(NUM_BU )
,trim(NUM_TYPETT)
,trim(NUM_ETT )
,trim(cast(DAT_VTE as varchar(10) ) )
,trim(NUM_CEN )
,trim(NUM_ART )
,trim(COD_REM )
,trim(QTE_VTE )
,trim(MNT_NET )
,trim(MNT_HT )
,trim(MNT_MRG )
,trim(MNT_REM )
,trim(COD_DEV )
,trim(cast( DAT_CRE as varchar(20) ) )
,trim(cast(DAT_MAJ as varchar(20) ) )
from admin_dev.O_AGG_AGGVTE_REFPETTPJOU
where not ( DAT_VTE between ''2010-01-01'' and ''2010-12-31'' )
;'
);
DEFINE OPERATOR FILE_WRITER_REQ1
TYPE DATACONNECTOR CONSUMER
SCHEMA SCHEMA_REFPETTPJOU
ATTRIBUTES (
FileName = 'C:/_LM/optimisations/test/O_AGG_AGGVTE_REFPETTPJOU.dat',
Format = 'DELIMITED',
TextDelimiter=';',
IndicatorMode = 'N',
OpenMode = 'Write'
);
APPLY TO OPERATOR (FILE_WRITER_REQ1[4]) /* parallelise 4 instances
de chargement en splitant le fichier en 4 */
SELECT
NUM_BU ,
NUM_TYPETT ,
NUM_ETT ,
DAT_VTE ,
NUM_CEN ,
NUM_ART ,
COD_REM ,
QTE_VTE ,
MNT_NET ,
MNT_HT ,
MNT_MRG ,
MNT_REM ,
COD_DEV ,
DAT_CRE ,
DAT_MAJ
FROM OPERATOR (EXPORT_OPERATOR[1]);
)
;
| |