Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Mon, 03 Mar 2008 @ 15:11:14 GMT

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

Subj:   Re: Oracle function %ROWTYPE
From:   Victor Sokovin

  Is there any function in teradata which can replace %ROWTYPE( IN ORACLE).  

Not in plain vanilla Teradata, where data types must be defined and fixed, and cannot be changed at run time.

However, if your Teradata release is recent enough, you could consider UDT (user-defined types) but I don't know how useful they are for converting Oracle stored procedures.

  And how to convert LAST_DAY(TRUNC(current_date,'YYYY')) equivalent teradata code.  

This seems to be the way to code the last day of the first month of the year. Well, if the author of this code preferred not to hard-code it to 31 Jan, then the code is probably meant to work for different calendars and will return different results for different regional settings.

31 Jan in Europe but probably 29 Feb in China (not sure and don't have time to test) etc.

The general problem with conversion of Oracle code to Teradata is Oracle's support of diverse regional (NLS) settings, which can vary from client to client, so it is important to know in which context the code is executed. Teradata does have some NLS support but it is rather limited compared to that of Oracle so while "translating" Oracle code you have to think of adding explicit support for all possible regional setting that your Oracle clients may use. It's a hard work so I'd say good luck to you.


  <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: 28 Jun 2020