Sunday, February 19, 2012

Inserting record in DB2 from Sql Server 2000

I am trying to insert a record in DB2 Database which is a Linked Server in SQl SERVER 2000.

I have tried fetching the value from DB2 Database using Openquery which is working fine, but when i try insertion of record it gives an error.

Follwoing is the Tsql I am using for insertion

insert into openquery(DB2_DB2T, 'Select Audit_nbr from $ZUDBA01.TPT200_VOLS where 1=0') values(9999999)

When i execute this Tsql i get following Error message

Server: Msg 7399, Level 16, State 1, Line 26
OLE DB provider 'MSDASQL' reported an error. The provider reported an unexpected catastrophic failure.
[OLE/DB provider returned message: Query cannot be updated because the FROM clause is not a single simple table name.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowsetChange::InsertRow returned 0x8000ffff: The provider reported an unexpected catastrophic failure.].

What could be the mistake I am making, Please help me out.

Thanks in Advance

Pranjal

You are doing an insert into a table and specifying a filter - it could be complaining about that

Try

insert into openquery(DB2_DB2T, 'Select Audit_nbr from $ZUDBA01.TPT200_VOLS') values(9999999)

also try

insert into openquery(DB2_DB2T, 'Select * from $ZUDBA01.TPT200_VOLS') values(all the values for the row)

|||

Hi,

I tried the query as you suggested by still I am encountering the same error. Please advice. Thanks

No comments:

Post a Comment