Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 17 May 2016 @ 19:02:45 GMT


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


Subj:   XQUERY Function issue within teradata when running from bteq
 
From:   Shetty, Vinay

Hi ,

I am facing XQUERY issue while running query from bteq .. same query when executed from SQL assistant runs fine ..

Query :

     SELECT
     SEQ_ID,
     QUOT_ID,
     QUOT_TYPE_ID,
     XMLSERIALIZE(CONTENT XMLQUERY('for $i in Decline/CorrelationId return $i'
     PASSING BY VALUE STAGE_ESB_DECLINE_REASON_XML.QUOT_XML
     RETURNING SEQUENCE
     NULL ON EMPTY
     ) AS VARCHAR(50)) AS CorrelationId
     ,ETL_HASH_KEY
     ,ETL_BATCH_ID
     ,ETL_SUB_TASK_STATC_ID
     ,ETL_SRC_KEY
     ,CURRENT_TIMESTAMP(6) AS ETL_INSRTN_DTTM
     ,CURRENT_TIMESTAMP(6) AS ETL_LAST_UPDTD_DTTM ,ETL_SRC_SYS_CD ,ETL_DATA_LINEAGE FROM EDP_DEV4_STG_QSA_DATA.STAGE_ESB_DECLINE_REASON_XML;

Error :

     SELECT
     SEQ_ID,
     QUOT_ID,
     QUOT_TYPE_ID,
     XMLSERIALIZE(CONTENT XMLQUERY('for "" in Decline/CorrelationId return data ("")'
     PASSING BY VALUE STAGE_ESB_DECLINE_REASON_XML.QUOT_XML
     RETURNING SEQUENCE
     NULL ON EMPTY
     ) AS VARCHAR(50)) AS CorrelationId
     ,ETL_HASH_KEY
     ,ETL_BATCH_ID
     ,ETL_SUB_TASK_STATC_ID
     ,ETL_SRC_KEY
     ,CURRENT_TIMESTAMP(6) AS ETL_INSRTN_DTTM
     ,CURRENT_TIMESTAMP(6) AS ETL_LAST_UPDTD_DTTM ,ETL_SRC_SYS_CD ,ETL_DATA_LINEAGE FROM EDP_DEV4_STG_QSA_DATA.STAGE_ESB_DECLINE_REASON_XML;
     *** Failure 9134 Error in function XMLQUERY: syntax error, unexpected "'...
     '", expecting  [err:XPST0003].
                     Statement# 1, Info =0
      *** Total elapsed time was 1 second.

Vinay Umesh Shetty
Associate Lead Technical Consultant
Global Delivery Center



     
  <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: 27 Dec 2016