![]() |
|
Archives of the TeradataForumMessage Posted: Thu, 20 May 2004 @ 15:42:26 GMT
<-- 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
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||