Re: Use of nvl

From: <hatzinger_m_at_bmwf1f.bmwf.gv.at>
Date: 19 Aug 92 09:59:40 GMT
Message-ID: <1992Aug19.082708.34_at_bmwf1f.bmwf.gv.at>


In article <5885.2a8fddad_at_hayes.com>, alacy_at_hayes.com writes:
> Hi
>
> We are in the process of evaluating a software package. We have been
> looking at their code and have run across what appears to be some strange
> code using the "nvl" function. I have included some of their WHERE
> clauses which do this:
>
> WHERE cust_no = nvl(null,:c.cust_no) ;
> WHERE FOB_CD = nvl(null,:C.FOB_CD) ;
> WHERE FREIGHT_CD = nvl(null,:C.FREIGHT_CD) ;
> WHERE SHIPVIA_CD = nvl(null,:C.SHIPVIA_CD) ;
> WHERE cust_no = nvl(null,:C.billto_cd) ;
> WHERE TERMS_CD = nvl(null,:C.TERMS_CD) ;
> WHERE cust_no = nvl(null,:C.billto_cd) ;
> WHERE HOLD_CD = nvl(null,:C.HOLD_CD) ;
> WHERE status_code = nvl(null,:C.order_status) ;
>
> If I understand the "nvl" function then the following expression from the
> first where clause
>
> nvl(null,:c.cust_no)
>
> means if null is equal to null then return the value of bind variable
> ":c.cust_no" which happens to be a screen variable. This means the
> expression will always return the value of ":c.cust_no". Is there any
> performance reason to do this? I would think this would actually slow the
> form down. But the forms which came with the package have this type of
> expression in a lot of places.
>
> Thanks!

I think there is no use for this type of expression. It's only to confuse and to slow down the form. Maybe the developer of this form used any special type of generator or konverter.

-- 

================================================================================
                                                                          ^
 Federal Ministry of Science and Research                               B | M
<-------------------------------------------------------------------------+---->
 Computer Center                                                        W | F
                                                                          |
 Klaus-Michael Hatzinger            mail: hatzinger_m_at_bmwf1f.bmwf.gv.at   |
 Bangkasse 1/209                   phone: 0043-222-53120/5188             |
 1014 Vienna, Austria                fax: 0043-222-53120/5155             V
================================================================================
Received on Wed Aug 19 1992 - 11:59:40 CEST

Original text of this message