Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to use TO_DATE function in OBI having MSSQL DB

753659Nov 30 2010 — edited Dec 20 2010
Hello Experts,

I am facing a problem plz help me.....

I've just created an business application using Oracle BI Administration Tool of Oracle BI Server version 10.1.3.4.1,with oracle DB.
But currently we migrate from Oracle to MSSQL Server. Due to which I am facing problem regarding Date Column (TO_DATE(), timestamp).
As I have created a report with 2 fields

Incident_Number, TimeStampAdd(SQL_TSI_SECOND,Incident_D.Reported_Date,timestamp '1970-01-01 00:00:00')

Incident_D.Reported_Date contains integer values which stores total seconds from date 01/01/1970 00:00:00 . I want to convert these seconds from 1970 to datetime.

when I ran the report with Oracle source it works fine, But with MSSQL as Source it gives me following error ...........


Odbc driver returned an error (SQLExecDirectW).

Error Details

Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P

State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 16001] ODBC error state: 37000 code: 8180 message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement(s) could not be prepared.. [nQSError: 16001] ODBC error state: 37000 code: 195 message: [Microsoft][SQL Server Native Client 10.0][SQL Server]'TO_DATE' is not a recognized built-in function name.. [nQSError: 16002] Cannot obtain number of columns for the query result. (HY000)

SQL Issued: SELECT Incidents."Incident Number" saw_0, TIMESTAMPADD(SQL_TSI_SECOND, Incidents."Reported Date", timestamp '1970-01-01 00:00:00') saw_1
FROM "ITSM Information" ORDER BY saw_0, saw_1


The Sql query log generated is as follow :

select distinct T728.INCIDENT_NUMBER as c1,
( CAST(TO_DATE('1970-01-01 00:00:00' , 'YYYY-MM-DD HH24:MI:SS') as DATE) + ( T728.REPORTED_DATE / 86400 ) ) as c2
from
INCIDENT_D T728
order by c1, c2


+++Administrator:ce0000:ce0002:----2010-11-30 14:51:38

-------------------- Query Status: Query Failed: [nQSError: 16001] ODBC error state: 37000 code: 8180 message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement(s) could not be prepared..
[nQSError: 16001] ODBC error state: 37000 code: 195 message: [Microsoft][SQL Server Native Client 10.0][SQL Server]'TO_DATE' is not a recognized built-in function name..
[nQSError: 16002] Cannot obtain number of columns for the query result.


Please Help me........
Thanks and Regards,

MJ
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details