I have an openquery that I using to hit an Oracle DB with from SQL server. The query runs without error but does not return any results. If I take out the sub select and change it to where pid = and input any of the ids on the list I get results.
Any ideas on what I am doing wrong?
SELECT * FROM openquery(DBtest04,
'SELECT * FROM DBUSER.PLOG where
pid in (''select pid from dbtest.dbo.gsy
'') and timeofevent > to_date(''2015-01-01 12:00'',''yyyy-mm-dd hh:mi'') ')
If I run this query I get 239 rows returned:
'SELECT * FROM DBUSER.PLOG where
pid = 990066657 and timeofevent > to_date(''2015-10-25 12:00'',''yyyy-mm-dd hh:mi'') ')