Have the following query that is giving error while executing through java driver, no errors while executing on DBVisualizer
SELECT pr.id,
pr.name,
CDPC.category_id,
CDPC.category_depth,
CDPC.product_count,
pr.primary_category_id
FROM ics_products_to_include_tmp inc
INNER JOIN catalog.products pr ON inc.product_id = pr.id
INNER JOIN catalog.products_in_categories pic ON pic.product_id = pr.id AND pic.active = true
INNER JOIN catalog.categories CC ON CC.id = pic.category_id AND CC.active = true
INNER JOIN category_depth_product_count_tmp CDPC
ON CDPC.category_id = CC.id
AND NOT EXISTS (SELECT *
FROM ics_products_cds_ids_tmp cds
WHERE cds.product_id = pr.id)
WHERE pr.site_id = '150'
ORDER BY pr.id
Here is the error
Exception in thread "main" org.postgresql.util.PSQLException: ERROR: syntax error at end of input Position: 495 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:381) at com.cnetchannel.ics.loader.IntermediateDatafeedGenerator.main(RRToIntermediateLoader.java:798) Disconnected from the target VM, address: '127.0.0.1:51077', transport: 'socket'
pr.site_id
is a numeric column you should not use single quotes for the comparison value.'150'
is a string value,150
is a number. – a_horse_with_no_name Jun 19 '13 at 8:02