Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sun, 14 Aug 2005 @ 18:42:28 GMT


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


Subj:   Re: DAYOFWEEK Function and BTEQ
 
From:   Victor Sokovin

  Receiving the following error in BTEQ but query is successful when run from queryman.is it not allowed?  


          > BTEQ -- Enter your DBC/SQL request or BTEQ command:
          >
          > select DAYOFWEEK('2005-08-12');
          >  *** Failure 3706 Syntax error: expected something between '(' and the
          > string '2'.
          >                 Statement# 1, Info =31
          >  *** Total elapsed time was 1 second.

DAYOFWEEK is a so called ODBC function. In SQLA (=Queryman), the query is translated by the ODBC driver to Teradata native SQL. The driver is aware of the function, so everything is fine (and transparent to the user).

BTEQ does not use ODBC and it is not aware of ODBC functions. Error 3706.

To submit your statement via BTEQ you'll have to rewrite it to native SQL. I have two suggestions which do not involve the system calendar.

1. Enable ODBC logging and search for the translated SQL. Perhaps it's all you need.

2. Use something like

     select  (FORMAT 'E4'); =

This will give you day names rather than numbers. You'll have to do the translation using CASE or something like that.


Regards,

Victor



     
  <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