Saturday, 15 June 2013

xml - Using query_to_xml in PostgreSQL with prepared statements -



xml - Using query_to_xml in PostgreSQL with prepared statements -

i'm using postgresql's function query_to_xml function generate xml of query result.

select * query_to_xml( 'select * some_table id = ?',true,false,'')

problem is, when utilize jdbc, prepared statements '?' ignored, postgres says:

"the column index out of range..."

is there possible solution pass parameters such query ?

try move ? outside string literal:

select * query_to_xml( 'select * some_table id = '||?,true,false,'')

xml postgresql prepared-statement

No comments:

Post a Comment