O'Reilly logo

Oracle SQL by Carol McCullough-Dieter, Gavin JT Powell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

22

Sequences and Synonyms

In this chapter:

  • What is a sequence object?

  • What are the uses of sequences?

  • What is a synonym?

In recent chapters we have examined tables, views, constraints, indexes, and clusters. Last but not least of the database objects we shall deal with directly in this book are sequences and synonyms.

Let’s begin this chapter with sequences, usually called Oracle sequence objects.

22.1 Sequences

A sequence allows for generation of unique, sequential values. Sequences are most commonly used to generate unique identifying integer values for primary and unique keys. Sequences are typically used in the types of SQL statements listed as follows:

  • The VALUES clause of an INSERT statement.

  • A subquery SELECT list contained within the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required