When using the Surrogate Key Generator Stage with Database Sequence, please note that before using the sequence values:
1. The "Sequence" needs to be created in the database in order to use it. Sequence creation script:
CREATE SEQUENCE Sequence_Name INCREMENT BY 1 START WITH 1 NOMAXVALUE CACHE 10;
2. For a Database sequence, note here to use appropriate action with respect to the following:
CYCLE:
Specify CYCLE to indicate that the sequence continues to generate values after reaching either its maximum or minimum value. After an ascending sequence reaches its maximum value, it generates its minimum value. After a descending sequence reaches its minimum, it generates its maximum value.
|
Specify NOCYCLE to indicate that the sequence cannot generate more values after reaching its maximum or minimum value. This is the default.
|
3. Test the Sequence on the database server side with script:
Select Sequence_Name.NextVal from dual;
4. Create sequence environmental variable on DataStage server side, to make the stage/job reusable
Source Type = Database
sequence
Source Name =
#db_server#.#db_name#.#schema#.<sequence_name>
The source name here should not be the
<table_name> but the oracle sequence name, which we had created in the above steps.
6. Alternatively, In the Target DB Stage you can when simply
inserting into your target table, use <sequence name>.nextval
in your insert statement.
Thanks!
Excellent post! I've been looking for that for a such time. Thank you
ReplyDeleteUsing source type:flat file is efficient or Db sequence ? Also in performance wise!!
ReplyDeletesmm panel
ReplyDeleteSmm Panel
iş ilanları
instagram takipçi satın al
hirdavatciburada.com
beyazesyateknikservisi.com.tr
servis
Tiktok Jeton Hile
ümraniye lg klima servisi
ReplyDeletekartal alarko carrier klima servisi
tuzla toshiba klima servisi
pendik samsung klima servisi
kadıköy vestel klima servisi
maltepe bosch klima servisi
üsküdar alarko carrier klima servisi
beykoz daikin klima servisi
çekmeköy beko klima servisi