MrDavidThorn
asked on
MS SQL select statement to Oracle, using alias
Hi Experts
Im using SQL server 2005 and have a linked server to an Oracle db, I am converting a query to use open query so get faster results.
the query I have is
SELECT RIMS_INSTRUMENT.INST_NUM,
RIMS_INSTRUMENT.[NAME],
RIMS_INSTRUMENT.INST_TYPE_ CODE,
RIMS_FUTR.LAST_EXERCISE_DA TE
FROM RIMS_TRS..RIMS.INSTRUMENT AS RIMS_INSTRUMENT
LEFT JOIN RIMS_TRS..RIMS.FUTR_OPTN_S ERIES AS RIMS_FUTR ON RIMS_INSTRUMENT.INST_NUM = RIMS_FUTR.INST_NUM
WHERE RIMS_INSTRUMENT.INST_TYPE_ CODE='EQTY ' Or (RIMS_INSTRUMENT.INST_TYPE _CODE='FUT R';
when I run the query the above query using Oracle I get the error message returned message "ORA-00933: SQL command not properly ended - Is it becuase Alias work in a different way in Orace?
Im using SQL server 2005 and have a linked server to an Oracle db, I am converting a query to use open query so get faster results.
the query I have is
SELECT RIMS_INSTRUMENT.INST_NUM,
RIMS_INSTRUMENT.[NAME],
RIMS_INSTRUMENT.INST_TYPE_
RIMS_FUTR.LAST_EXERCISE_DA
FROM RIMS_TRS..RIMS.INSTRUMENT AS RIMS_INSTRUMENT
LEFT JOIN RIMS_TRS..RIMS.FUTR_OPTN_S
WHERE RIMS_INSTRUMENT.INST_TYPE_
when I run the query the above query using Oracle I get the error message returned message "ORA-00933: SQL command not properly ended - Is it becuase Alias work in a different way in Orace?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There is an open bracket at the beginning of the last line that is not closed.
ASKER
sorry this is the actual query I am running
select * FROM OPENQUERY
(RIMS_TRS,'SELECT TEST2.INST_NUM FROM RIMS.INSTRUMENT AS TEST LEFT JOIN RIMS.FUTR_OPTN_SERIES AS TEST2 ON TEST.INST_NUM = TEST2.INST_NUM')
select * FROM OPENQUERY
(RIMS_TRS,'SELECT TEST2.INST_NUM FROM RIMS.INSTRUMENT AS TEST LEFT JOIN RIMS.FUTR_OPTN_SERIES AS TEST2 ON TEST.INST_NUM = TEST2.INST_NUM')
ASKER
think I found the problem Oracle doesnt like me using the AS statement for somereason