Hi People...
I have an MS SQL Server database linked to an Oracle database. The oracle database table is set up with two columns: itplan_lookup_id and itplan_project_name (both numeric, a sequence has been created for the _id column).
I am trying to run the following query from SQL Server:
I get the following error:
How can I resolve this issue? I assume it has to do with the column I am ignoring -- I thought it would just auto-increment, but I'm being moronic most likely.
In Oracle, I would use the sequence_name.nextval call, but not here...
Thanks for your help,
Cory
*cLFlaVA
----------------------------
[tt]( <P> <B>)13 * (<P> <.</B>)[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
I have an MS SQL Server database linked to an Oracle database. The oracle database table is set up with two columns: itplan_lookup_id and itplan_project_name (both numeric, a sequence has been created for the _id column).
I am trying to run the following query from SQL Server:
Code:
insert KINTANA..KN.KN_GCR_ITPLAN_LOOKUP( itplan_project_id )
select p.sub_id
from sub_project p join cost_release r
on p.sub_id = r.sub_id
where p.sub_project_stat_cd = 'ACT'
and r.release_year = year(getdate())
group by p.sub_id
having sum(r.release_amount) > 0
order by p.sub_id;
I get the following error:
Code:
(0 row(s) affected)
Server: Msg 7344, Level 16, State 1, Procedure update_kintana_lookups, Line 9
OLE DB provider 'MSDAORA' could not INSERT INTO table '[KINTANA]..[KN].[KN_GCR_ITPLAN_LOOKUP]' because of column 'ITPLAN_LOOKUP_ID'. The column used the default value.
[OLE/DB provider returned message: Multiple-step operation generated errors. Check each status value.]
OLE DB error trace [OLE/DB Provider 'MSDAORA' IRowsetChange::InsertRow returned 0x80040e21: Data status sent to the provider: [COLUMN_NAME=ITPLAN_PROJECT_ID STATUS=DBSTATUS_S_OK], [COLUMN_NAME=ITPLAN_LOOKUP_ID STATUS=DBSTATUS_S_DEFAULT]. Data status returned from the provider: [COLUMN_NAME=ITPLAN_PROJECT_ID STATUS=DBSTATUS_E_UNAVAILABLE], [COLUMN_NAME=ITPLAN_LOOKUP_ID STATUS=DBSTATUS_E_BADSTA...
How can I resolve this issue? I assume it has to do with the column I am ignoring -- I thought it would just auto-increment, but I'm being moronic most likely.
In Oracle, I would use the sequence_name.nextval call, but not here...
Thanks for your help,
Cory
*cLFlaVA
----------------------------
[tt]( <P> <B>)13 * (<P> <.</B>)[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]