Zero Result from query (started with VServer)
Barney Hyde
barney at custombased.com
Fri Nov 14 12:26:58 CST 2003
On Friday, November 14, 2003, at 12:13 PM, Arthur Clemens wrote:
> I am a bit puzzled by the search results from a table. The only way to
> ask is to give this elaborate example:
>
> I have these fields:
>
> mfIsOpen("is_open"),
> mfKindOfWord("kind_of_word", 20, "Slovenian", fIndexed),
> mfGenderOfNoun("gender_of_noun", 20, "Slovenian", fIndexed),
> mfEndingOfNoun("ending_of_noun", 20, "Slovenian", fIndexed),
> mfConjugationOfVerb("conjugation_of_verb", 20, "Slovenian", fIndexed),
> mfTypeOfVerb("type_of_verb", 20, "Slovenian", fIndexed),
> mfCaseInfliction("case_infliction", 20, "", fIndexed),
> mfEndingOfAdjective("ending_of_adjective", 20, "Slovenian", fIndexed),
> mfComment("comment", 50, "", fIndexed),
>
> I populate them from a file, but not all fields of each record are
> filled:
>
> 1 prid -na -no 1
> 1 medm 2
> 1 sam m -a 3
> 1 sam m -ja 4
> 1 sam ž -e 5
> 1 prid -na -no 6
> 1 sam m f√°nta 7
>
> For instance, field 3 ("gender_of_noun") is only filled if the word is
> a noun - it is filled in records 3, 4, 5 and 7.
>
> Now when I do a SQL query for each field (yes, this could be
> optimized), I have for instance this statement:
>
> SELECT gender_of_noun FROM grammar WHERE parent = 1
>
> ("parent" is the last field).
>
> The field "gender_of_noun" of the first record is empty, yet I get 1
> result back (but with an empty string)
>
> Err = 0 ; mCursor = 0x4b46c00
> number of results: 1
>
> FBL_String* fblStr = cursor->GetString( "gender_of_noun" );
>
> I find this strange. Shouldn't I get zero results?
No this is right isn't it.
You are asking for the contents of the 'gender_of_noun' field from all
records
in the database where the parent field has a 1 in it.
As it happens there IS a record in your database where the data in the
parent field
= 1
consequently the Query returns to you the data in the 'gender_of_noun'
field from this record.
In this case the data is " " ie nothing.
More information about the Valentina
mailing list