Create a StoresLocation table as follows:

Working with Procedures, Variables, Sequences, and User Functions 12-21

5. Type in the Native Sequence Name or click the browse button to select a sequence

from the list pulled from the data server.

6. If you clicked the Browse button, in the Native Sequence Choice dialog, select a

Context to display the list of sequences in this context for your logical schema.

7. Select one of these sequences and click OK.

8. From the File menu, click Save.

The sequence appears in the Projects or Others tree in Designer Navigator.

12.3.3 Using Sequences and Identity Columns

In order to increment sequences, the data needs to be processed row-by-row by the agent. Therefore, using sequences is not recommended when dealing with large numbers of records. In this case, you would use database-specific sequences such as identity columns in Teradata, IBM DB2, Microsoft SQL Server or sequences in Oracle. The sequences can be used in all Oracle Data Integrator expressions, such as in: ■ Mappings, ■ Filters, ■ Joins, ■ Constraints, ■ ... Sequences can be used either as: ■ A substituted value, using the SEQUENCE_NAME_NEXTVAL syntax ■ A bind variable in SQL statements, using the :SEQUENCE_NAME_NEXTVAL syntax Using a sequence as a substituted value A sequence can be used in all statements with the following syntax: SEQUENCE_ NAME_NEXTVAL With this syntax, the sequence value is incremented only once before the command is run and then substituted by its valued into the text of the command. The sequence value is the same for all records. Using a sequence as a bind variable Only for SQL statements on a target command of a KM or procedure, sequences can be used with the following syntax: :SEQUENCE_NAME_NEXTVAL With this syntax, the sequence value is incremented, then passed as a bind variable of the target SQL command. The sequence value is incremented in each record processed by the command. The behavior differs depending on the sequence type: ■ Native sequences are always incremented for each processed record. ■ Standard and specific sequences are resolved by the run-time agent and are incremented only when records pass through the agent. The command in a KM or procedure that uses such a sequence must use a SELECT statement on the source command and an INSERT or UPDATE statement on the target command rather than a single INSERTUPDATE... SELECT in the target command. For example: