Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 19 Aug 2010 @ 08:42:10 GMT


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


Subj:   Getting the name of an SPL
 
From:   Selim GUBUK

Hi everyone,

Is there a way (maybe a function or constant) to get the name of the SPL in that SPL.

It may sound weird but I have a generic code which logs errors of an SPL. I don t want to write the name of SPL every time (We have already made a mistake on a copy/paste operation :)

     REPLACE PROCEDURE SPL_FINANCIAL_EVENT_010 (IN P_ETL_DATE DATE) BEGIN
       DECLARE SPL_NAME VARCHAR(30) DEFAULT 'SPL_FINANCIAL_EVENT_010';

     ----------------------------------------------------------------------------
       -- EXCEPTION HANDLING
     ----------------------------------------------------------------------------
       DECLARE EXIT HANDLER FOR SQLEXCEPTION
       BEGIN
         INSERT INTO DWH.DWH_LOG VALUES (:P_ETL_DATE, :SPL_NAME, CURRENT_TIMESTAMP, 'Error');
       END;
     END;

In above code, I need a function like this:

     DECLARE SPL_NAME VARCHAR(30);
     SET SPL_NAME := GET_SPL_NAME();

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