Re: VFP 9: SQL: sum() of Zero Items

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



tim_witort@xxxxxxxxxxx (Tim Witort) wrote:

Gene Wirchenko seemed to utter in
news:1f5pl25kus8mbo11tnjnn5i26f3ds7r9p9@xxxxxxx:

"AA" <A@A> wrote:

Null doesn't exist in mathematics, does it? It exists in the SQL
language and in data structures.
In the example with a join query that I posted, the Null helps to
distinguish between an account where + and - balances out to 0 and an
account the doesn't exist according to the terms of the join.

It is not needed. Query directly for the account. If you get a
row back, the account exists.

And the solution for you is equally simple. Check the value
of _TALLY after performing your SQL SELECT. I always check
_TALLY after any operation like this. It's good programming.

It would not work here. I am expecting one row with a value.
When .null. is returned in the row, I still get one row. Since _tally
would have the same value each time, it is not appropriate.

We'd all like certain features to natively support our
particular use, but they don't always do that. That's why
programming is more than throwing a few fomulas together
and turning the crank like in Excel.

The code worked just fine in VFP 6. It does not in 9. You are
right about the not always.

You would do better to realize how your tool works and use
it accordingly. You made a programming mistake. Admit it
and move on. Complaining that the SQL language doesn't

0 is mathematically the sum of zero elements. If SQL gets this
wrong, well, SQL got it wrong.

treat your case like you expect will do nothing. Trust me,
the hundreds of implementations of SQL and VFP's in particular
are not going to abandon the use of .NULL. in such a case.
The use of .NULL. in this and other cases are key to made
RDBMSs work correctly.

NULL is not needed at all for RDBMSs.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
.



Relevant Pages

  • Re: VFP 9: SQL: sum() of Zero Items
    ... In the example with a join query that I posted, ... Query directly for the account. ... It's good programming. ... Complaining that the SQL language doesn't ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Full-Text Catalog does not build...
    ... You're welcome, Oleg, ... I've not confirmed if the Arabic language will be a FTS supported ... language in SQL Server 2005, you may want to review the ...
    (microsoft.public.sqlserver.fulltext)
  • Re: SQL
    ... Language can and do this. ... SQL is typed, ... How about something from the domain of custom biz apps. ... yet nobody would even try to use RDBMS for that. ...
    (comp.object)
  • Re: Databases as objects
    ... Isn't SQL able to assimilate to business vocabulary? ... using the same domain-ignorant language? ... Isn't the database schema already a domain-specific interface? ... have lesser lines of code than a corresponding assembler source code. ...
    (comp.object)
  • Re: SQL
    ... to have an ability to place things into cells ... It is a language issue then. ... An RDBMS engine that may ... Put a program code in a relational table and write compiler in SQL ...
    (comp.object)