ORAOCI9 and sequences

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
kh
Participant
Posts: 21
Joined: Mon Jun 09, 2003 11:16 am

ORAOCI9 and sequences

Post by kh »

We intend to use DataStage for integrating data between OLTP applications. Many of the target tables are in Oracle and have primary keys that are typically populated (by the OLTP application) using a sequence (sequence_name.nextval).

Is there a way to get the ORAOCI9 stage to do this with a user-defined SQL statement? (Example: INSERT INTO table (id, fld1, fld2) VALUES (myseq.nextval, :1, :2)

It seems like this should be fairly simple to do, but as soon as you're forced to enter the table name on the General tab, your user-defined query is lost (replaced with a generated one).

Is there a way to do this? How about a work-around?

Regards, Kevin
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

This really shouldn't be an issue. [?] Once you select an Update Action of 'User Defined SQL', the Table Name on the General tab is essentially ignored. Under the 'SQL' tab, the 'Generated' tab should be disabled and the 'User-defined' tab should be active - and stay that way unless you change the Update Action.

You might try putting the table name in first. Since it will be ignored when you go User Defined, you could put "DUAL" or even "USER_DEFINED" in there to help people recognize what's going on.

-craig
jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Post by jseclen »

Hi Kevin,

Check this last item ...

http://www.tools4datastage.com/forum/to ... ms=nextval


Miguel Seclen
Lima - Peru
Post Reply