Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problems with Multiple LEFT joins in Queries using JDBC OBC Driver

843859Jul 16 2009 — edited Nov 20 2014
I am trying to use 2 Left Join Statements in a Query that is executed on Access 2003. When the same query is executed in Access it runs fine and returns the correct results, but When I execute it from Java code, I get the following error..

The Table Structure is

Item Name Quantity Buy_Sell LotQoh
ABC 100 Buy 90
ABC 10 Sell
XYZ 100 Buy 90
XYZ 10 Sell

The query goes like this:

SELECT T.ItemName,
Sum(TradePur.Quantity) AS Purchase,
Sum(TradeSale.Quantity) as Sales,
Sum(TradePur.LotQoh) AS StockOnHand

FROM ((Trade AS T) LEFT JOIN Trade AS TradePur ON (T.Row_id = TradePur.Row_id and TradePur.Buy_sell = "BUY")
LEFT JOIN Trade AS TradeSale ON (T.Row_id = TradeSale.Row_id and TradeSale.Buy_sell = "SELL"))
GROUP BY t.ItemName

Error:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Join expression not supported.


Any directions to resolve this will be highly appreciated.

Thanks in anticipation.
Rusk
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 14 2009
Added on Jul 16 2009
12 comments
121 views