On 4/2/07, Rick Hillegas <Richard.Hillegas@sun.com> wrote:
It seems to me that the compiler should not think it has enough
information at prepareStatement() time to assign the ? a type of
VARCHAR. That looks like a bug to me.
As a workaround, the following statement gives the compiler enough
information to correctly type the ? parameter. This allows you to set
the ? parameter to a null VARBINARY value and then execute the query.
This works under both the embedded and network clients:
select count(*) from Issue where cast (? as varchar(20) for bit data) is null
Xavier Hanin wrote:
> On 3/31/07, *Oystein Grovlen - Sun Norway* < Oystein.Grovlen@sun.com
> <mailto:Oystein.Grovlen@sun.com>> wrote:
> Xavier Hanin wrote:
> > On 3/31/07, *ōystein GrÝvlen* < Oystein.Grovlen@sun.com
> > I'm using version 10.2.2.0 <http://10.2.2.0> < http://10.2.2.0>.
> > There have been some
> > fixes in this area lately (see DERBY-1610), and I will try
> your test
> > case on the development trunk later today.
> > Ok, thanks a lot.
> I tried the development version, and now it fails for both client and
> embedded. The failure in the client is probably due to stricter type
> checking in the client driver. What happens seems to be that the
> compiler determines the type of the parameter to be VARCHAR during
> compilation, and hence you get a type mismatch later. I do not
> understand why it does so. If nobody can explain why, this is
> a bug, and I suggest you open a new JIRA issue for this.
> JIRA issue created: DERBY-2507
> Thanks for your help!
> - Xavier
> Learn Ivy at ApacheCon: http://www.eu.apachecon.com/
> Manage your dependencies with Ivy!