Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 openquery to oracle

Author  Topic 

jamie
Aged Yak Warrior

542 Posts

Posted - 2004-11-01 : 04:54:54
hello, I am trying to run this query against a linked server to oracle and get an error :

SELECT *
FROM OPENQUERY(ORA_DB,
'SELECT UP_ID, FORENAME, SURNAME, DOB
FROM STUDENT WHERE DOB < ''getdate()'' ')
GO


err:
Server: Msg 7320, Level 16, State 2, Line 1
Could not execute query against OLE DB provider 'MSDAORA'.


hoew can I do the dob < getdate() ( as this is the problem )

thank you.
Jamie

mfemenel
Professor Frink

1421 Posts

Posted - 2004-11-01 : 10:23:52
I'd reccomend just using sysdate, which is oracle's version of getdate or you have to change your query to something like this:
where dbo<' + getdate() + '')'

Mike
"oh, that monkey is going to pay"
Go to Top of Page

jamie
Aged Yak Warrior

542 Posts

Posted - 2004-11-02 : 07:23:10
thanks mike, sysdate has done the trick
Go to Top of Page
   

- Advertisement -