Hi there,
Here at 8kdata we widely use jOOQ on ToroDB to dinamically generate SQL
staments. I am developing a new feature that will automatically generate
some views, but I am blocked with a strage error from my backend database.
I am using jOOQ 3.6.4 and PostgreSQL as backend and dialect. The generated
statment is something like:
create view "test"."whatever1"("did", "whatever2", "whatever3")
as select "test"."t_3"."did", "test"."t_3"."whatever2",
"test"."t_3"."whatever3" from "test"."t_3"
join "test"."root"
on "test"."t_3"."did" = "test"."root"."did"
where ("test"."root"."sid" = ? and "test"."t_3"."index" is null)
The error I recive from postgres is the following
*ERROR: there is no parameter $1*And when I turn on the jooq logging this
is printed:
DEBUG org.jooq.tools.LoggerListener - Executing query : create view
"test"."whatever1"("did", "whatever2", "whatever3") as select
"test"."t_3"."did", "test"."t_3"."whatever2", "test"."t_3"."whatever3" from
"test"."t_3" join "test"."root" on "test"."t_3"."did" = "test"."root"."did"
where ("test"."root"."sid" = ? and "test"."t_3"."index" is null)
DEBUG org.jooq.tools.LoggerListener - -> with bind values : create view
"test"."whatever1"("did", "whatever2", "whatever3") as select
"test"."t_3"."did", "test"."t_3"."whatever2", "test"."t_3"."whatever3" from
"test"."t_3" join "test"."root" on "test"."t_3"."did" = "test"."root"."did"
where ("test"."root"."sid" = 1 and "test"."t_3"."index" is null)
If I do not execute the query calling org.jooq.Query#execute but instead I
render the sql with org.jooq.Query#toSQL(org.jooq.conf.ParamType) and
then I execute it with org.jooq.DSLContext#execute, I have no problems.
The funny thing is that there are some other views that are being generated
in a very simmilar way, using similar code and they are rendereized in the
same way (both on logs and with toSQL method) but they can be executed
without problems.
I am sure this problem is originated on my code, I may need to specify
something to jOOQ to change the way it speaks with the driver or something
like that.
Do you have any ideas of what is happening?
Bests,
Gonzalo
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.