I am attempting to do an insert and update(2 seperate flows of course) from a SQL source into an Oracle destination. I followed the process given in this link: http://sqlblog.com/blogs/andy_leonard/archive/2007/07/09/ssis-design-pattern-incremental-loads.aspx
Because my destination contains a column which uses Oracle's Sequence I am unable to use just an OLE DB destination or the Oracle destination(attunity drivers) so I modified the New Rows path(Insert path) to use an OLE DB Command and entered the following T-sql statement in the Componenent Properties SQL Command:
insert into AWQMSO.FIRM (
FIRM_ID,
ACM_FIRM_ID,
MSTR_FIRM_ID,
ACTV_IND,
FIRM_STAT_TXT,
CRTE_BY_USR_ID,
CRTE_DTTM,
LST_UPDT_BY_USR_ID,
LST_UPDT_DTTM)
values (
FIRM_SEQ.Nextval,
?,
?,
?,
?,
?,
?,
?,
?)
The package then fails on the OLE DB Command(insert) with a rather useless error message of:
Error: 0xC0202009 at Data Flow Task, OLE DB Command 1 [571]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E55.
Which is repeated 152 times... the exact number of rows that should be inserted into the destination table.
The update path however works fine(almost...still fighting with a date format) using a similar T-sql statement:
Update AWQMSO.FIRM
set
FIRM_STAT_TXT = ?
,ACTV_IND = ?
,LST_UPDT_BY_USR_ID = ?
where ACM_FIRM_ID = ?
The only difference I can see is in the hard coding of the .Nextval so I tried creating a derived column containing "FIRM_SEQ.Nextval" without the quotes. Changed the FIRM_SEQ.Nextval to a ? and mapped the value to the newly derived field which gives me a more informative error message that the data cannot be inserted into the FIRM_ID field but still leaves me with the same problem.
I have successfully used an Execute SQL task to insert a single row into a statistics table in Oracle with a sequence field using variables and a paremeterized query. That was only a single row though with 4 columns and I don't know how to reproduce the same sort of thing to get each individual row of my dataset into a variable then execute the insert and move to the next row.
Thanks in advance for your help!