Oracle concept of a SEQUENCE

Database
Enthusiast

Oracle concept of a SEQUENCE

We have a feature we are looking for in Teradata and were told it was not available in version 12. It is analogous to the Oracle concept of a SEQUENCE although it would be fine if Teradata called it something else. Is there a way for us to find out if it will be available in Teradata version 13?
4 REPLIES
Enthusiast

Re: Oracle concept of a SEQUENCE

You can look in the release summary, but I can tell you that version 13 doesn't have that feature.
Enthusiast

Re: Oracle concept of a SEQUENCE

Thanks Jim. Are you with Teradata, or perhaps I should contact them?
Enthusiast

Re: Oracle concept of a SEQUENCE

It’s a unique number that counts upwards, for instance:

CREATE SEQUENCE MY_SEQ; # Create Sequence
SELECT MY_SEQ.NEXTVAL FROM DUAL; # Returns the number 1
SELECT MY_SEQ.NEXTVAL FROM DUAL; # Returns the number 2
SELECT MY_SEQ.CURRVAL FROM DUAL; # Returns the number 3 (CURRVAL doesn’t move the sequence forward)
SELECT MY_SEQ.CURRVAL FROM DUAL; # Returns the number 4

This doesn’t seem very useful at first glance, it is more commonly used with Insert statements; but it does show how the sequence works.
Enthusiast

Re: Oracle concept of a SEQUENCE

Hello Mandre,

I believe you can define a column as IDENTITY column to generate sequential numbers. You do not need to create a sequence separately.

Does the below post contain what you are looking for?

http://forums.teradata.com/forum/database/teradata-identity-columns

Thanks,
M