Re: IN clauses via setObject(Collection) [Was: Re: Prepare

From: Fernando Nasser <fnasser(at)redhat(dot)com>
To: Darin Ohashi <DOhashi(at)maplesoft(dot)com>
Cc: 'Dmitry Tkach' <dmitry(at)openratings(dot)com>, 'Oliver Jowett' <oliver(at)opencloud(dot)com>, Kim Ho <kho(at)redhat(dot)com>, Barry Lind <blind(at)xythos(dot)com>, pgsql-jdbc-list <pgsql-jdbc(at)postgresql(dot)org>, Dave Cramer <Dave(at)micro-automation(dot)net>
Subject: Re: IN clauses via setObject(Collection) [Was: Re: Prepare
Date: 2003-07-21 19:39:17
Message-ID: 3F1C4165.5010503@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Darin Ohashi wrote:
>>There is no technical reason why sql prepare cannot support "IN ?"
>>If it is not supported by the backend at the moment should not affect
>>the general decision of whether or not having such a feature
>>is useful
>>to have in the jdbc driver or not.
>>

Unfortunately it does. How can we justify a feature that only works when we are
simulating prepared statements and fails when we are using the real PREPARED
statements as provided by the server?

The current implementation of PREPARE in the backend does not allow us the
syntax to specify in any way that we intend to provide a list of values for the
? parameter that would go into the IN clause and even give a syntax error if we
try to specify a ? in there (with or without the parenthesis).

I don't have the embedded SQL'99 spec here to check that, but if there isn't a
standard way to do that it will be hard to convince the backend folks to
implement it. Haven't they thought of this case, where someone wants to
dynamically provide an <in value list> ?

This would probably require a special protocol feature to upload the list of
values as the parsing has already been done so we cannot just send the "(1, 2,
3, )' string. We need to send the actual length of the list followed by the values.

This is getting too complicated... :-(

--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser(at)redhat(dot)com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dmitry Tkach 2003-07-21 19:45:23 Re: IN clauses via setObject(Collection) [Was: Re: Prepare
Previous Message Dmitry Tkach 2003-07-21 19:16:39 Re: IN clauses via setObject(Collection) [Was: Re: Prepare