Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 11 Oct 2005 @ 13:02:13 GMT


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


Subj:   Error handling in Procedure
 
From:   Anomy Anom

<-- Anonymously Posted: Tuesday, October 11, 2005 06:34 -->

Hi,

I require help in writing procedure. Here is my requirement.

While transforming I need to log error code along with its key column into error table if a particular record fails to process.

Also process should proceed further after logging for that particular culprit record.

For example, in Oracle, I can handle it as follows,

     FOR i IN cursor_ LOOP

          BEGIN

               INSERT INTO table_
               VALUES ( i.Column_1, i.Column_2 ) ;

          EXCEPTION
               WHEN OTHERS THEN

                    sqlmsg :=  i.Column_1 || ' - ' || SQLERRM ;

                    INSERT INTO error_log ( Column_1 )
                    VALUES ( sqlmsg ) ;

          END ;
     END ;

Thanks in advance.



     
  <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