Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 20 May 2004 @ 15:42:26 GMT


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


Subj:   Operation ++
 
From:   Anomy Anom

<-- Anonymously Posted: Thursday, May 20, 2004 11:41 -->

Hi,

I am trying out to find out a way to implement ++ or incremental operation in minimal effort in a stored procedure.

Here is the description -

One message is inserted for each step in a proc into a log table. I mention the step number as well -

     SET vLog_Msg = "STEP 1 : Insert into staging table."

     INSERT INTO Job_Log (vLog_Msg,..);

I want to automate the generation of sequence number for the steps so that even if I change the sequence of steps the number should be maintain the sequence -

     SET x=1;

     SET vLog_Msg = "STEP" || :x++ || " : Insert into staging table."

     SET vLog_Msg = "STEP" || :x++ || " : Update the staging table."

There could be more complex method to generate an identity numbers (CSUM, etc) but I am looking for some trick method to avoid extra work and performance degradation.


Thanks



     
  <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