Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Problem pulling data from oracle

Problem pulling data from oracle

From: Bobby Singh <bobsingh1_at_hotmail.com>
Date: Thu, 09 Jan 2003 15:45:08 -0800
Message-ID: <3E1E0984.CD6EF460@hotmail.com>


Hi,

I am trying to write a procedure in SQL server which is pulling data from oracle db using OLE and updating tables. I am running into an date time issue. Here's the select statement

 SELECT DISTINCT R.AGREEMENT_NUM AS PAID, R1.RELATIONSHIP_SUBTYPE AS PSubType

   FROM ORCLOLE..PRF_USER.RELATIONSHIP R, ORCLOLE..PRF_USER.RELATIONSHIP_SUBTYPE R1    WHERE ((UPPER(R.AGREEMENT_NUM) LIKE 'DAR%') OR (UPPER(R.AGREEMENT_NUM) LIKE 'CAN%'))
      AND UPPER(R.AGREEMENT_NUM) NOT LIKE 'DAR99%' AND UPPER(R.AGREEMENT_NUM) NOT LIKE 'DAR88%'       AND UPPER(R.AGREEMENT_NUM) NOT LIKE 'CAN%.' AND R.END_DATE >= DATEADD(day, -120, GETDATE())

The getdate portion of this is giving an error

Error converting data type DBTYPE_DBTIMESTAMP to datetime

Basically in oracle its just sysdate-120 but because SQL server doesn't recognize sysdate, it errors out there.
Another thing, it was working fine with 8i. As soon as we upgraded to 9i, this started happening. Does anyone know a compatible equivalent of getdate that both systems might recognize?

Bobby Received on Thu Jan 09 2003 - 17:45:08 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US