Subject | Coalesce Help |
---|---|
Author | Muthu Annamalai |
Post date | 2004-08-23T14:46:26Z |
Need help in my Stored Procedure which is as follows
SELECT COALESCE(OPENINGBALANCE,0), COALESCE(CASHIN,0),
COALESCE(CASHOUT,0), COALESCE(CLOSINGBALANCE,0)
FROM CASHACTIVITY
WHERE CASHACTIVITY.TODAY =:SALESDAY
INTO :OPENINGBALANCE,:CASHIN,:CASHOUT,:CLOSINGBALANCE;
In CashActivity Table, if there is no record for given salesday then
my SP is returning nulls, which I expect to return zero's.
I could easily handle this situation using if null construct, the
problem is ( recently ) after learning about COALESCE i changed many
of my SP's and now I am scared whether I am using coalesce in right
sense.
All my null values are handles at FB itself, not a single one in
client side.
Any help is highly appreciated,
Regards,
Muthu
SELECT COALESCE(OPENINGBALANCE,0), COALESCE(CASHIN,0),
COALESCE(CASHOUT,0), COALESCE(CLOSINGBALANCE,0)
FROM CASHACTIVITY
WHERE CASHACTIVITY.TODAY =:SALESDAY
INTO :OPENINGBALANCE,:CASHIN,:CASHOUT,:CLOSINGBALANCE;
In CashActivity Table, if there is no record for given salesday then
my SP is returning nulls, which I expect to return zero's.
I could easily handle this situation using if null construct, the
problem is ( recently ) after learning about COALESCE i changed many
of my SP's and now I am scared whether I am using coalesce in right
sense.
All my null values are handles at FB itself, not a single one in
client side.
Any help is highly appreciated,
Regards,
Muthu