All Forums Database
JoeMM-5216 9 posts Joined 11/07
03 Dec 2007
How to accomplish this in Teradata

Hi,I need to generate the sequence ids. So here is my plan.1) Lock table (not sure which lock level method should use)2) select max(id)+1 into variable from table3) update table set id=max(id)+14)unlock table.For that, how can I do it in Teradata.Thnx in advance,JMM

leo.issac 184 posts Joined 07/06
06 Dec 2007

Try using functions like Row_Number and Rank. Or try to define the column as Identity column.Refer Teradata documentation regarding the above mentioned functions

Luckyhansh 30 posts Joined 08/06
07 Dec 2007

lock table for writeupdate table set key=valueselect max(col)+1 as value from tablerelease lock

You must sign in to leave a comment.