Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 16 Feb 2005 @ 10:17:44 GMT


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


Subj:   How to use a string in TWB script.
 
From:   Kumar_Hare

Hi All,

I have a FE Script, which I have converted to TWB script using command :

     >>  pcnvfexp -i FE_GEOGRAPHY_MKT.txt -o twgeo.txt

when I run script, I am getting the following error:

     C:\test>tbuild -f twgeo.txt
     Teradata Warehouse Builder Run Utility Version 04.00.00
     line 74: syntax error at "MARKET" missing RPAREN_ in Rule: Attribute
     Specification
     syntax error in Rule: Operator Invocation
     syntax error in Rule: Query Specification
     syntax error in Rule: Simple Table
     syntax error in Rule: Query Term
     syntax error in Rule: LOAD Statement
     Compilation failed due to errors.
     Execution Plan was not generated.
     PX_Compiler failed with status = 25

'Market or Geography' is the string used for 'Geography description' in the select statement.

Below is the script generated. See the "SelectStmt" attribute in the script below.

I have tried many options like /'market/', "market", \'market\' ' 'market' ', but nothing works.

Any input how can we use string value in the TWB select statement.

Another option I feel can be that we can define a default value for this somewhere but don't know where, still struggling , any help will be appreciated.


Thanks in advance,


     DEFINE JOB PRODUCT_SOURCE_EXPORT
     DESCRIPTION 'EXPORT PRODUCT DEFINITION TABLE'
     (

       DEFINE SCHEMA PRODUCT_SOURCE_SCHEMA
       DESCRIPTION 'PRODUCT INFORMATION SCHEMA'
       (
       );

       DEFINE OPERATOR FILE_WRITER()
       DESCRIPTION 'TERADATA WB DATACONNECTOR OPERATOR'
       TYPE CONSUMER
       INPUT SCHEMA *
       EXTERNAL NAME 'libdtac'
       ALLOW PARALLEL MULTIPHASE
       MSGCATALOG 'pdatacon'
       ATTRIBUTES
         (
           VARCHAR PrivateLogName = 'dc_log',
           VARCHAR FileName,
           VARCHAR OpenMode,
           VARCHAR IndicatorMode,
           VARCHAR Format='Formatted'
         );

       DEFINE OPERATOR EXPORT_OPER ()
       DESCRIPTION 'TERADATA WB EXPORT OPERATOR'
       TYPE PRODUCER
       OUTPUT SCHEMA PRODUCT_SOURCE_SCHEMA
       EXTERNAL NAME 'libexpop'
       ALLOW PARALLEL MULTIPHASE
       MSGCATALOG 'pcommon'
       ATTRIBUTES
       (
             VARCHAR PrivateLogName = 'exp_log',
             INTEGER BlockSize,
             INTEGER TenacityHours,
             INTEGER TenacitySleep,
             INTEGER MaxSessions,
             INTEGER MinSessions,
             VARCHAR DateForm,
             VARCHAR TdpId,
             VARCHAR WorkingDatabase,
             VARCHAR UserName,
             VARCHAR UserPassword,
             VARCHAR AccountId,
             VARCHAR SelectStmt
       );

       LOAD INTO OPERATOR
       (    FILE_WRITER()
            ATTR
            (
              FileName = '"..\DAT\FE_MKT_GEOGRAPHY.dat"',
              IndicatorMode = 'Y',
              OpenMode = 'Write'
            )
       )

       SELECT * FROM OPERATOR
       ( EXPORT_OPER() [1]
          ATTR
          (
            TdpId ='DBC',
            UserName = 'USR',
            UserPassword = 'USR',
            SelectStmt=
             'SELECT
                     MAPPED_ID              (INTEGER)        AS GEOGRAPHY_IDENTIFIER
                     ,1                     (BYTEINT)        AS GEOGRAPHY_TYPE_CODE
                     ,NULL                  (DATE)           AS GEOGRAPHY_EFFECTIVE_DATE
                     ,NULL                  (DATE)           AS GEOGRAPHY_END_DATE
                     ,TRIM(DISPLAY_VALUE)   (VARCHAR(35))    AS GEOGRAPHY_NAME
                     ,'MARKET OR CIRCLE'    (VARCHAR(100))   AS GEOGRAPHY_DESCRIPTION

             FROM bp_SEDW_90.ST_MARKET_CODE_VALUES AS STG_MKT
                     INNER JOIN bp_TEDW.MAP_GEOGRAPHY_KEY AS MAP_GEO_KEY
                     ON TRIM(MAP_GEO_KEY.GEOGRAPHY_OP_SYS_ID) = TRIM(STG_MKT.MARKET_CODE)
                     AND MAP_GEO_KEY.SOURCE_SYSTEM_CODE=90;        '
          )
       );
     );


     
  <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: 15 Jun 2023