Cannot fetch a row using a bookmark from OLE DB provider 'OraOLEDB.Oracle

Blog: "Cannot fetch a row using a bookmark from OLE DB provider 'OraOLEDB.Oracle' for linked server"

I had this problem that any update statment using a linked server to oracle would give the above error message.

After a lot of googleing I finally found this blog with the following solution:

The statement that caused the error was:
UPDATE [MyOraLinkedServer]..[XYZ].[TABLE]SET [DAT_COL] = cast (getdate() as smalldatetime)


The destination table contained just one single row. The update should change the column DAT_COL to the current date and time.

A solution for that problem is to use EXEC('...') AT MyOraLinkedServer instead of the UPDATE-statement I showed above:

declare @NewValue smalldatetimeset
@NewValue = cast(getdate() as smalldatetime)
exec( 'update XYZ.TABLE set DAT_COL = ?', @NewValue ) at MyOraLinkedServer

To make this possible you have to enable RPC on the linked server

Comments

Anonymous said…
Thank you so much! you just saved our day!

Popular posts from this blog

Manual de alarma Chevrolet

http://www.colombiasoyyo.org