Subject Re: [firebird-support] How to force data type of returned value in query?
Author Sergio H. Gonzalez
>I have a query like this:
>
> SELECT SUM(INVOICE.TOT_OWING)
> FROM INVOICE
> WHERE INVOICE.FK_ACCOUNT_ID = :A_ACCOUNT_ID AND
> (((:V_CURRENT_DATE - INVOICE.INVOICE_DATE) >=31) AND ((CAST('NOW' AS
> DATE) - INVOICE.INVOICE_DATE) <=60)) AND
> INVOICE.IS_PROCESSED = 'Y'
> INTO :V_30_INV_TOTAL;
>

In these cases I always do (inmediatly after the select)

if (V_30_INV_TOTAL is null) then
V_30_INV_TOTAL = 0;


-s