Reputation: 21
I am trying to update the table row in MS Access from NetBeans. But I am getting the error -
net.ucanaccess.jdbc.UcanaccessSQLException: unexpected token: LEFT required: SET
I had tested the query directly in MS-Access, which is working perfectly. But when I use that same query in NetBeans it throwing the error.
My Update Query :
ps_ins_new_prod = con.prepareStatement("UPDATE Inv_Category LEFT JOIN Inv_Product ON Inv_Category.Category_ID = Inv_Product.Category_ID SET Inv_Product.[Size] = ?, Inv_Product.Quantity = ?, Inv_Product.Item_No = ?, Inv_Product.Purchase_Price = ?, Inv_Product.Selling_Price = ?, Inv_Product.Category_ID = ? WHERE (((Inv_Product.Product_Name)=?) AND ((Inv_Product.Size)=?) AND ((Inv_Category.Category_Name)=?) AND ((Inv_Product.Quantity)=?) AND ((Inv_Product.Item_No)=?) AND ((Inv_Product.Purchase_Price)=?) AND ((Inv_Product.Selling_Price)=?) AND ((Inv_Product.Category_ID)=?))");
Upvotes: 2
Views: 601
Reputation: 32980
Internally Ucanaccess runs your query against a HSQLDB database which does not support LEFT OUTER JOINS in an UPDATE.
See this thread for a discussion and a possible workaround using the MERGE command.
Upvotes: 1