Subject | Re: [firebird-support] NULL parameters in Stored Procedures failing updates |
---|---|
Author | Ann W. Harrison |
Post date | 2006-06-27T17:40:54Z |
Luis Madaleno wrote:
AND (DOCUMENTO=:REF_DOCUMENTO or :ref_documento is null)
AND NOT (:orbra_id is null and :ref_documento is null);
The last bit keeps two null values from changing the whole table.
Regards,
Ann
> ...WHERE (OBRA_ID=:OBRA_ID or :obra_id is null)
> UPDATE CONTAS_CORRENTES_FOR SET
> TOTAL_LIQUIDADO=TOTAL_LIQUIDADO+:LIQUIDADO
> WHERE OBRA_ID=:OBRA_ID AND DOCUMENTO=:REF_DOCUMENTO;
> /* the problem is here. if :OBRA_ID is null, this UPDATE fails */
> END
> END
> end^
>
> is there any way to force this UPDATE to work when one parameter is null?
>
AND (DOCUMENTO=:REF_DOCUMENTO or :ref_documento is null)
AND NOT (:orbra_id is null and :ref_documento is null);
The last bit keeps two null values from changing the whole table.
Regards,
Ann