I posted this under SSIS, but then realized that it's not really an SSIS question (although I'm not sure if this is the right place for it either) Sorry for the cross post. It just wasn't clear to me where I should put it.
In SQL Server I've created a linked server to an Oracle database. I am trying to insert (within the context of an sql server table trigger) an SQL Server datetime to an Oracle column with similar precision. Oracle timestamps are not compatible with sql server datetimes and I don't know how to convert the data (or if I should use a different type of column to store the data in Oracle). I have full control over the structure of the Oracle table so I can use a different type if timestamp is not best, but I need the destination column to have at least the same precision as the sql server datetime value. What is the easiest way to do this
Delighted to receive your reply, but still mystified. Charmed that you marked your reply as the answer despite the fact that you didn't post the question. I'm sure that you have a good reason, though it escapes me at the moment since your reply doesn't seem to be true in my case. Perhaps I am misunderstanding your answer since you referred to an ISO 8601 format. I am not employing any formatting at all, but writing directly from an SQL Server column to an Oracle column. Can you give an example piece of sql that utilizes the aforementioned format The following simple piece of sql will not work:
INSERT INTO MyOracleLinkedServer..SomeSchema.SomeTable (SomeOracleTimestampColumn) Select SomeSqlTimestampColumn FROM MySqlServerTable
LoRez wrote:
Delighted to receive your reply, but still mystified. Charmed that you marked your reply as the answer despite the fact that you didn't post the question. I'm sure that you have a good reason, though it escapes me at the moment since your reply doesn't seem to be true in my case. Perhaps I am misunderstanding your answer since you referred to an ISO 8601 format. I am not employing any formatting at all, but writing directly from an SQL Server column to an Oracle column. Can you give an example piece of sql that utilizes the aforementioned format The following simple piece of sql will not work:
INSERT INTO MyOracleLinkedServer..SomeSchema.SomeTable (SomeOracleTimestampColumn) Select SomeSqlTimestampColumn FROM MySqlServerTable
Hi LoReZ,
Thanks for posting your views. Did you see my Title thread - "Error Converting Oracle timestamp into Sql Server Datetime" - Indeed I was able to find answer for my question. Surely I'll try from my side and let you know if I get the answer for your issue.
Thanks
Subhash Subramanyam
Here is the error I am receiving: Msg 7354, Level 16, State 1, Line 1
The OLE DB provider "OraOLEDB.Oracle" for linked server "ORACLE_FREIGHT_RECEIVING" supplied invalid metadata for column "TESTTIMESTAMP". The data type is not supported.
Here is the SQL that creates the error:
INSERT
INTO ORACLE_FREIGHT_RECEIVING..FREIGHT.MOBILE_TEST (TESTTIMESTAMP) VALUES(GETDATE())
The Oracle timestamp has a precision of 3.
Still not able to insert records in Oracle Timestamp field with the data from SQL Datetime field. Insert statement is
INSERT INTO DWHOLP2_OLE..WLIRT.EXCEPTIONMESSAGEREGISTRY
SELECT CONVERT(CHAR(23),SystemMessageCreationDateTime,126),
Versionuser from EXCEPTIONMESSAGEREGISTRY
and the error dispalyed is
Server: Msg 7354, Level 16, State 1, Line 1
OLE DB provider 'OraOLEDB.Oracle' supplied invalid metadata for column 'SYSTEMMESSAGECREATIONDATETIME'. The data type is not supported.
OLE DB error trace [Non-interface error: Column 'SYSTEMMESSAGECREATIONDATETIME' (ordinal 4) of object '"WLIRT"."EXCEPTIONMESSAGEREGISTRY"' reported an unsupported value for DBTYPE of 13].
This issue seems to be related to Oracle OLE DB driver.