Page 1 of 1

Insert Multiple rows into a oracle table

Posted: Tue Nov 22, 2011 5:23 pm
by balu536
Hi All,

I am inserting the data into oracle table by using the odbc stage.

Say employee_name table,
There is after insert trigger on the employee_name table for inserting the data into the employee_sports table

ES_ID, Employee_name, Sports
ES_ID is primary key

This trigger works like below

For every new employee it inserts two records into the employee_sports like if we get 'A' then this table will have

1 A Soccer
2 A Baseball

New ES_ID is populated by fetching the maximum value of its ES_ID +1 and inserts a new record into table.

So i kept the options as below in the ODBC stage.

Isolation level=ReadCommitted
Record count=1
Array_Size=1
Auto Commit Mode on.

I ran job in parallel and kept a copy stage execution mode as 'SEQUENTIAL', before the odbc stage.

The job aborts and say that
I am getting a unique key violated constraint on the employee_sports.

Is there a problem with the job ?
Is there a problem for fetching the maximum value in the employee_sports?

Thanks in advance

Re: Insert Multiple rows into a oracle table

Posted: Tue Nov 22, 2011 5:41 pm
by karthikdsexchange
The stage in sequential mode will wait till all records are processed and avaliable, then stage will process them and avaliable for next link. So you are using the copy stage with sequential mode. So it is using same ES_ID I guess. Use this as a tip.

Posted: Tue Nov 22, 2011 6:22 pm
by ray.wurlod
What is the primary key of the employee_sports table?