Re: Prepared Statements - Mailing list pgsql-jdbc

From Dmitry Tkach
Subject Re: Prepared Statements
Date
Msg-id 3F186430.8030908@openratings.com
Whole thread Raw
In response to Re: Prepared Statements  (Darin Ohashi <DOhashi@maplesoft.com>)
List pgsql-jdbc
>
>
>Just as a data point, both postgresql's documentation for PREPARE
>
>http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=sql-prepare.html
>
>and IBM's
>
>http://www-3.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/document.d2w
>/report?fn=db2v7s0sqls0645.htm#HDRPREPH2
>
>imply that only data can be passed in.  Its by implication because they discuss
>the "data" having a "datatype".  I'm not sure this would make sense if you were
>allowed to pass in strings containing SQL syntax.
>
>
>
That's fine.
I just don't know why you refuse to call a set, containing numbers (or
strings or whatever else) 'data'...
What about arrays by the way?
Is {1,2,3,4} not 'data' too?

There is a similar problem with arrays in the current driver (that is
just about to become worth with this patch) too -
the only way I know to send in an array to a statement like

update mytable set array_field = ? where id=?

is, again, to use setObject () with the properly constructed string
representation of the array
(there is a setArray(), but no way to construct the actual
java.sql.Array object to pass there)

It sounds like we are about to arrive to the new definition of 'data' as
"something that is supported by our jdbc driver" :-)

Dima



pgsql-jdbc by date:

Previous
From: Darin Ohashi
Date:
Subject: Re: Prepared Statements
Next
From: Fernando Nasser
Date:
Subject: Re: Prepared Statements