Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Thu, 11 Dec 2008 @ 10:08:26 GMT


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


Subj:   Re: Exception handling for stored procedures and functions
 
From:   Sridhar Nakka

Hi All,

Thank you very much for your inputs on the issue. I do know that we can use parallel sql statements in place of stored procedures. But in our application we migrating the system from oracle to teradata. We call these procedures using informatica mappings. So I think I can't write parallel sql statements for this purpose. For example I have a function

CREATE OR REPLACE function F_GET_SHOW_AIR_DAY(p_Date in date,p_time number) return number is

        v_Day varchar(20);
        v_StrTime varchar(6);
     begin
        v_StrTime :=lpad(to_char(p_time),6,0);

        if to_number(substr(v_StrTime,1,2))<5 then
           select to_char(p_Date-1,'D') into v_Day from dual;
        else
           select to_char(p_Date,'D') into v_Day from dual;
        end if;
        RETURN to_number(v_Day);

        exception
            when no_data_found then
              null;
        RETURN -1;
     end;
     /

Without using stored procedure how can I write this function using sql statements. This will be called by informatica work flow. So if we can change this into sql statements, please tell me how to do the same.


Regards

Sridhar Nakka



     
  <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