I am using ucanaccess jdbc driver and connecting to MS Access.
When I run this code..
String lDynamicSql = "SELECT orders.customer AS D1, SUM(orders.order_value) AS S1
FROM
( orders orders)
GROUP BY orders.customer
ORDER BY orders.customer";
pStatement = lConnection.prepareStatement(lDynamicSql);
.. I get the following error:
net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::4.0.2 unexpected token: ( : line: 3 in statement [SELECT orders.customer AS D1, SUM(orders.ID) AS S1
FROM
( orders orders)
GROUP BY orders.customer
ORDER BY orders.customer]
Any ideas why the driver inserts the square brackets and how do I stop them from being inserted please?
Thanks for any help as I realise I must be doing something wrong!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am using ucanaccess jdbc driver and connecting to MS Access.
When I run this code..
.. I get the following error:
Any ideas why the driver inserts the square brackets and how do I stop them from being inserted please?
Thanks for any help as I realise I must be doing something wrong!
Just for debugging purposes, can you try changing
to
and see if the error goes away?
Hi Gord,
Thanks for the quick reply.
I tried that and it works.. we don't need the brackets, so that's fine.
Another developer put the brackets in, so I assume they were needed at some point!??
Anyway, thanks for your help Gord.
Steve.