Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Query to tables having special characters

artafon July 14, 2016

Hi.

I have working query on postgre, but when I trying to use it in PQ, I get an error:

SELECT cast((TO_TIMESTAMP((SELECT "END_DATE" FROM 
"AO_60DB71_SPRINT" 
where "RAPID_VIEW_ID"=3343 and "STARTED" = 't' and "COMPLETE_DATE" is NULL) / 1000)) as date)

Stack Trace

org.postgresql.util.PSQLException: ERROR: syntax error at or near "'AO_60DB71_SPRINT'" Position: 54 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2182) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1911) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:173) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:615) at 

1 answer

1 accepted

0 votes
Answer accepted
Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 18, 2016

Hi Artashes,

Thanks for you question! Does this also happen if you remove the double quotes?

SELECT cast((TO_TIMESTAMP((SELECT END_DATE FROM
AO_60DB71_SPRINT
where RAPID_VIEW_ID=3343 and STARTED = 't' and COMPLETE_DATE is NULL) / 1000)) as date)

Regards, Felix (Scandio)

artafon July 18, 2016

Felix, Hi!

 

I solved the problem as follows for postgre:

SELECT DATE(TO_TIMESTAMP((SELECT "END_DATE"  FROM "AO_60DB71_SPRINT" where "RAPID_VIEW_ID"=3343 and "STARTED" = 't' and "COMPLETE_DATE" is NULL)/1000));


Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events