Subject | Re: [ib-support] setNull doesn't work |
---|---|
Author | Claudio D'Angelo |
Post date | 2002-07-30T09:36:20Z |
At what to be used for the PreparedStatement if I have to build dinamically
the statement given that the setNull doesn't select the data?
The setNull isn't useful and if i have the possibility to have null value
the PreparedStatement isn't useful too.
At 10.35 30/07/2002 +0200, you wrote:
Software Consultant
ObjectWay S.p.A.
Via G.A. Boltraffio 7
20159 Milano (MI)
http://www.objectway.it
[Non-text portions of this message have been removed]
the statement given that the setNull doesn't select the data?
The setNull isn't useful and if i have the possibility to have null value
the PreparedStatement isn't useful too.
At 10.35 30/07/2002 +0200, you wrote:
>Claudio,Claudio D'Angelo
>
>Please read again ...
>
>Your statement is this, right?
>
>select *
>from mytable
>where mycolumn = ?
>
>Then, you can set the value of the parameter any way you like, right?
>
>For example:
>
>5 -> which results in a statement to be executed:
>select *
>from mytable
>where mycolumn = 5
>
>This can return a row.
>
>Now, if you use setNull, the statement results in:
>select *
>from mytable
>where mycolumn = NULL
>
>Now, this does NOT work - the setNull method works (it sets the VALUE of the
>parameter to NULL) - but the query will never return any rows, because the
>SQL WHERE clause ( where mycolumn = NULL ) never results into TRUE.
>
>The only way to test if a column is NULL, is like this:
>
>where mycolumn is null
>
>
>
>
>Please read the above and ask specific questions about what you don't
>understand.
>
>Martijn Tonies
>InterBase Workbench - the developer tool for InterBase and Firebird
>http://www.interbaseworkbench.com
>
>Upscene Productions
>http://www.upscene.com
>
>"This is an object-oriented system.
>If we change anything, the users object."
>
>
> > The driver doesn't communicate with SQL but with its machine language.
> >
> > However MYCOLUMN=NULL don't work in interbase becouse it's a syntax error.
> > JDBC Driver' interbase should communicate traslating the setNull in
> > MYCOLUMN in null
> >
> > At 10.08 30/07/2002 +0200, you wrote:
> >
> > > > But this is a bug, don't you?
> > >
> > >No it's not. I explained that to you. There's no such thing as
> > >MYCOLUMN = NULL --- this does not work. If you replace NULL
> > >by a parameter and set it to NULL, it will still not work.
>
>
>
>
>To unsubscribe from this group, send an email to:
>ib-support-unsubscribe@egroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Software Consultant
ObjectWay S.p.A.
Via G.A. Boltraffio 7
20159 Milano (MI)
http://www.objectway.it
[Non-text portions of this message have been removed]