On Wed, 19 Aug 2015 14:40:42 +0200, Paul Vinkenoog <p...@vinkenoog.nl>
wrote:
>> The way I read it, "set the XSQLVAR.sqlind to NOT NULL and leave
>> XSQLVAR.sqldata NULL." refers to the "? IS NULL" parameter, not the
first
>> parameter ("SOME_COL = ?").
> 
> If you read it in context (see below), you see that param1 refers to the
> first positional parameter and param2 (not mentioned in Tsutomu's post)
> to the second.
> 
>>From the 2.5.4 Release Notes:
> 
> "The implementation works like this. To resolve the first problem, the
> request must supply two parameters (for our Delphi example):
> 
>   WHERE col1 = :param1 OR :param2 IS NULL
> 
> • If “param1” is not NULL, the language interface is required to assign
>   the correct value for the first parameter, set the XSQLVAR.sqlind to
>   NOT NULL and leave XSQLVAR.sqldata NULL.
> 
> • If “param2” is NULL, the language interface is required to set the
>   XSQLVAR.sqlind of both parameters to NULL and leave the
>   XSQLVAR.sqldata NULL."
> 
> Even apart from the incorrect "and leave XSQLVAR.sqldata NULL", this
> text is a bit confusing and incomplete. It should be something like
this:
> 
> "First of all, the language interface should ensure that :param1 and
> :param2 have the same value (or nullness), as they reflect the same user
> level variable. Then,
> 
> - If they are not NULL, XSQLVAR.sqldata of the first param must point
> to the value and XSQLVAR.sqldata of the second param must be null (null
> pointer, not SQL NULL).
> 
> - If they are NULL, XSQLVAR.sqldata of both params must be null (null
> pointer, not SQL NULL).
> 
> In all cases, XSQLVAR.sqlind of both params must reflect the nullness
> of the parameter (i.e. point to a -1 value for NULL, or 0 for NOT
NULL)."
> 
> To be honest, I didn't quote the entire text from the RelNotes. With the
> paragraphs that follow, you can figure out how everything should be set
> up, but it's a bit of a puzzle.
> 
> You could also sum up the instructions like this:
> "Set up both XSQLVAR's like you would normally do and make them equal,
> but set XSQLVAR.sqldata of the SQL_NULL param to null at all times."

I agree that the wording can be improved, but I read it in context, and I
still stand by my previous comment. The way I read "is required to assign
the correct value for the first parameter", is that you need to do
everything with the first parameter you'd normally do, and then for the
implied - but not explicitly mentioned - second parameter "set the
XSQLVAR.sqlind to NOT NULL and leave XSQLVAR.sqldata NULL".

I also think that the wording "set the XSQLVAR.sqlind to NOT NULL" and
"XSQLVAR.sqldata NULL" is correct enough for anyone familiar with the
low-level API.

Mark

------------------------------------------------------------------------------
_______________________________________________
Firebird-docs mailing list
Firebird-docs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-docs

Reply via email to