thanks for reply, but your suggested code:
Rick Curtis wrote:
>
> Query query = em.createNativeQuery("SELECT id FROM :?1 WHERE (next_run -
> now() < interval '2 minutes')", Long.class);
> query.setParameter(1, HARVEST_SCHEDULES_TABLE);
>
produces systax error: (i don't know why the exception sais :? and not :?1 ,
weird)
> ERROR: syntax error at or near ":"
> Position: 16 {prepstmnt 9497985 SELECT id FROM :? WHERE (next_run -
> now() < interval '2 minutes')
>
i tried to change it to this:
> Query query = em
> .createNativeQuery(
> "SELECT id FROM ?1 WHERE
> (next_run - now() < interval '2 minutes')",
> Long.class);
>
but its also not working:
> ERROR: syntax error at or near "$1"
> Position: 16 {prepstmnt 8172621 SELECT id FROM ? WHERE (next_run - now()
> < interval '2 minutes')
>
thanks for some suggestion, Juraj
--
View this message in context:
http://openjpa.208410.n2.nabble.com/java-lang-IllegalArgumentException-no-named-params-tp5080072p5083226.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.