Hi Guys,
I have an issue with Update on an Openquery that points to an oracle server.
UPDATEOPENQUERY (DWHNY,'SELECT UPLOAD_STATUS FROM app_cpm.PROCESS_CONTROL_CPM WHERE BUSDATE= ''11-Dec-2012'' ')
SET UPLOAD_STATUS='12-Dec-2012 14:55:02';
message:
OLE DB provider "MSDASQL" for linked server "DWHNY" returned message "[Oracle][ODBC]Option type out of range <0>.".
Msg 7343, Level 16, State 4, Line 1
The OLE DB provider "MSDASQL" for linked server "DWHNY" could not UPDATE table "[MSDASQL]".
I think, the dateformat for the update is not correct. The guys from the oracle side suggest to use
UPDATEOPENQUERY (DWHNY,'SELECT UPLOAD_STATUS FROM app_cpm.PROCESS_CONTROL_CPM WHERE BUSDATE= ''11-Dec-2012'' ')
SET UPLOAD_STATUS=TO_DATE('12-Dec-2012 14:55:02', 'DD-MON-YYYY HH24:MI:SS').
But this will not work so I have to use the correct format.
A select * from OpenQuery as above works fine.
Can anyone help me with this issue?
The linked Server is defined as follows:
EXEC master.dbo.sp_addlinkedserver @server = N'DWHNY', @srvproduct=N'SQLServer', @provider=N'MSDASQL', @datasrc=N'MyDataSource'