SQL Help Please

T

tkosel

I think I posted this in the wrong area previously. I received notification
of a response, but cannot get to it. I think I posted in reports, when it
belongs here. Here it is again. Sorry about that.

I have created a pass through query to get data from an Oracle Database.
The SQL appears below.

SELECT STATION.STN_NAME, PRODUCT.PROD_ID, PRODUCT.PROD_NAME, SETUP.SETUP_ID,
SETUP.SETUP_NAME, V_DATA.PIECE_NMBR, CHAR_SETUP.CHAR_NAME, V_DATA.VAR_VALUE
FROM ((((PRODUCT INNER JOIN SG_DATA ON PRODUCT.PROD_ID = SG_DATA.PROD_ID)
INNER JOIN SETUP ON SG_DATA.SETUP_ID = SETUP.SETUP_ID) INNER JOIN V_DATA ON
SG_DATA.SG_ID = V_DATA.SG_ID) INNER JOIN CHAR_SETUP ON V_DATA.CHAR_ID =
CHAR_SETUP.CHAR_ID) LEFT JOIN STATION ON SG_DATA.STN_ID = STATION.STN_ID
WHERE (((PRODUCT.PROD_ID) = 1403125760) And ((SETUP.SETUP_ID) = 1454899200))
ORDER BY V_DATA.PIECE_NMBR, CHAR_SETUP.CHAR_NAME;

I have a similar regular query to the appropriate linked tables in the
database that works fine. I need to, for a variety of reasons, use a pass
through query. The SQL above yields the following error.

ODBC-call failed

[ORACLE][ODBC][Ora]ORA-00928: missing SELECT keyword
(#928)

I have several other similar (not as complex though) pass through queries
that work fine to the same database. Any Ideas why this one doesn't work?
 
A

Armen Stein

I think I posted this in the wrong area previously. I received notification
of a response, but cannot get to it. I think I posted in reports, when it
belongs here. Here it is again. Sorry about that.

I have created a pass through query to get data from an Oracle Database.
The SQL appears below.

SELECT STATION.STN_NAME, PRODUCT.PROD_ID, PRODUCT.PROD_NAME, SETUP.SETUP_ID,
SETUP.SETUP_NAME, V_DATA.PIECE_NMBR, CHAR_SETUP.CHAR_NAME, V_DATA.VAR_VALUE
FROM ((((PRODUCT INNER JOIN SG_DATA ON PRODUCT.PROD_ID = SG_DATA.PROD_ID)
INNER JOIN SETUP ON SG_DATA.SETUP_ID = SETUP.SETUP_ID) INNER JOIN V_DATA ON
SG_DATA.SG_ID = V_DATA.SG_ID) INNER JOIN CHAR_SETUP ON V_DATA.CHAR_ID =
CHAR_SETUP.CHAR_ID) LEFT JOIN STATION ON SG_DATA.STN_ID = STATION.STN_ID
WHERE (((PRODUCT.PROD_ID) = 1403125760) And ((SETUP.SETUP_ID) = 1454899200))
ORDER BY V_DATA.PIECE_NMBR, CHAR_SETUP.CHAR_NAME;

I have a similar regular query to the appropriate linked tables in the
database that works fine. I need to, for a variety of reasons, use a pass
through query. The SQL above yields the following error.

ODBC-call failed

[ORACLE][ODBC][Ora]ORA-00928: missing SELECT keyword
(#928)

I have several other similar (not as complex though) pass through queries
that work fine to the same database. Any Ideas why this one doesn't work?

Couple of ideas:

Remove the final semi-colon (;) - I'm not sure what Oracle would think
about that.

Try pasting the exact statement directly into Oracle's query designer
to see if it works, and if not what the error is.

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SQL Help Please 2
Pass Through Query Help!!! 3

Top