Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Problem pulling data from oracle
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