Is this a safe query to write?

SELECT NVL(SUM(Amount),0) FROM MyTable WHERE condition = .T. INTO ARRAY 
laCnt

I added the NVL because without it, the result could be .NULL. and the 
array doesn't get created.  I ask this question because the idea of an 
NVL around a SQL SUM seems odd to me, like it wouldn't evaluate in the 
proper sequence perhaps.

I'm using INTO ARRAY because the code is in a loop that runs a lot and 
it's shorter/easier (imo) code that going INTO CURSOR for just a SUM.

-- 
Michael J. Babcock, MCP
MB Software Solutions, LLC
http://mbsoftwaresolutions.com
http://fabmate.com
"Work smarter, not harder, with MBSS custom software solutions!"



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to