Link to home
Start Free TrialLog in
Avatar of MrDavidThorn
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_DATE
            FROM RIMS_TRS..RIMS.INSTRUMENT AS RIMS_INSTRUMENT
            LEFT JOIN RIMS_TRS..RIMS.FUTR_OPTN_SERIES 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='FUTR';

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
Avatar of Pratima
Pratima
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
There is an open bracket at the beginning of the last line that is not closed.
Avatar of MrDavidThorn
MrDavidThorn

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')

think I found the problem Oracle doesnt like me using the AS statement for somereason