Re: Prepared statement with function as argument: how to bind values?
От | alexbruy |
---|---|
Тема | Re: Prepared statement with function as argument: how to bind values? |
Дата | |
Msg-id | 132b310f-65ae-494f-a2bb-e314c1b6c7c5@n12g2000yqh.googlegroups.com обсуждение исходный текст |
Ответ на | Prepared statement with function as argument: how to bind values? (alexbruy <alexander.bruy@gmail.com>) |
Ответы |
Re: Prepared statement with function as argument: how to bind values?
|
Список | pgsql-jdbc |
Hi, On 23 сен, 16:25, p...@fastcrypt.com (Dave Cramer) wrote: > Do you have to quote 'POINT(?,?)' Yes, because this is argument of ST_GeomFromText function. On 23 сен, 19:28, msakre...@truviso.com (Maciek Sakrejda) wrote: > Since that's an argument to ST_GeomFrom*Text*, I imagine he does. Or > do you mean is he quoting the parameter value with SQL apostrophe > quotes, which he shouldn't?. In any case, that looks like a weird > API--if there's a different function you can call, Alex, that will > take an actual point object, that would probably make your life > easier. Unfortunately there is no another function that can take actual point. But it is possible to create stored procedure that will take all necessary arguments. > If this is all you have to work with, the problem is that you can't > parameterize a text literal. I think you would need to pass the full > String 'POINT(34.567 45.5621)' as a jdbc parameter value. However, I > don't quite understand the error you're getting. I would expect > complains about extra parameters, not about the number of columns > (which looks legit). Thanks, I'll try. Regarding error message, I find it a bit confusing. As I understand, it says about number of columns because there are 5 columns listed in query and I try to bind value to non existing 6 column. Thanks, Alex
В списке pgsql-jdbc по дате отправления: