Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 07 Nov 2011 @ 22:21:31 GMT


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


Subj:   Error encountered with multi-line comments in SQL
 
From:   Anomy Anom

<-- Anonymously Posted: Monday, November 07, 2011 17:01 -->

Hi Folks,

I am facing an interesting problem while executing the following parameterized query in SQL Assistant.

The query works fine without the multi-line comment but fails to execute when the comment is present. The error returned is :

3707:? Syntax error, expected something like an 'END' keyword between the word 'dayofmonth' and '('.


Can anyone please help me understand why SQL Assistant is behaving in this way ? I am using SQL Assistant ver 12.0.0.13, Teradata ver 12.00.0333 12.00.03.33 and ODBC driver ver 12.00.00.06.

The complete query is given below.

     Select
     a.pat_id,
     a.pat_name,
     /*? (CASE WHEN CLARITY_DEP.DEPT_ABBREVIATION IS NOT?? NULL THEN??
     CLARITY_DEP.DEPT_ABBREVIATION?
     ?????????????? CLARITY_DEP_adm.DEPT_ABBREVIATION??? END? )?? AS?
     DEF_THEN_ADM_DEPT_ABBR,? */
     b.pat_enc_csn_id max_cntc_date
     from
     hcclnc.patient a
     inner join
     hcclnc.pat_enc b
     on a.pat_id = b.pat_id
     WHERE?
     HSP_TRANSACTIONS.TX_POST_DATE >= case
     when 'Last Full Month' = 'Last Full Month' then add_months(current_date, -1)
     - dayofmonth(current_date) +1
     when 'Last Full Month' = 'Last Full Week' Then current_date -
     dayofweek(current_date) -6
     else CAST('11/11/11' AS DATE FORMAT 'YY/MM/DD')? end
     AND HSP_TRANSACTIONS.TX_POST_DATE<= case
     when 'Last Full Month' = 'Last Full Month' then current_date -
     dayofmonth(current_date)?
     when 'Last Full Month' = 'Last Full Week' Then current_date -
     dayofweek(current_date)
     else CAST('11/11/11' AS DATE FORMAT 'YY/MM/DD')? end

Thanks much.



     
  <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