Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sun, 26 Sep 2004 @ 12:43:36 GMT


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


Subj:   Re: Function "Monthname" in SQL Assistant
 
From:   Dieter Noeth

Victor Sokovin wrote:

  I think the question comes from Oracle background where one can set one's own NLS settings for the client and get the SQL results customized to them (days, months, first day of the week, even SQL error messages, etc).  


At least MS SQL Server allows the same, would be so nice to have it in Teradata, too :-)


  I did not do any special research on this particular function in the Teradata ODBC driver (that's where month names come from) but my guess would be that the standard driver can't produce translations into local languages.  


I just turned on Access Logging to check the SQL produced by the ODBC driver (tdprsr32.dll):

     (TRIM(SUBSTR('         January  February March    April    May      June
     July     August  SeptemberOctober  November December '
     , ((((( col ) (DATE))(INTEGER))+19000000)/100 MOD 100)*9 + 1,9))
     (TITLE ' Monthname()'))

  1. reference table with all French data in it;
2. CASE construct in the SQL statement.
 


3. Use that ugly SUBSTR ;-)


  These alternatives completely eliminate the need to use the ODBC function.  


and work also if "Allow use of ODBC SQL Extensions in queries" is unchecked and even in BTEQ...


Dieter



     
  <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