Re: Prepared Statements

From: Dmitry Tkach <dmitry(at)openratings(dot)com>
To: Darin Ohashi <DOhashi(at)maplesoft(dot)com>
Cc: pgsql-jdbc-list <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Prepared Statements
Date: 2003-07-18 21:18:40
Message-ID: 3F186430.8030908@openratings.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Fernando Nasser 2003-07-19 00:47:18 Re: Prepared Statements
Previous Message Darin Ohashi 2003-07-18 21:05:37 Re: Prepared Statements