home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / database / oracle / 1310 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  1.5 KB

  1. Path: sparky!uunet!hayes!alacy
  2. From: alacy@hayes.com
  3. Newsgroups: comp.databases.oracle
  4. Subject: Use of nvl
  5. Message-ID: <5885.2a8fddad@hayes.com>
  6. Date: 17 Aug 92 17:11:08 EDT
  7. Keywords: SQLFORMS,NVL function
  8. Organization: Hayes Microcomputer Products, Norcross, GA
  9. Lines: 30
  10.  
  11. Hi
  12.  
  13. We are in the process of evaluating a software package. We have been 
  14. looking at their code and have run across what appears to be some strange 
  15. code using the "nvl" function.  I have included some of their WHERE 
  16. clauses which do this:
  17.  
  18.              WHERE cust_no = nvl(null,:c.cust_no) ;
  19.              WHERE FOB_CD = nvl(null,:C.FOB_CD) ;
  20.              WHERE FREIGHT_CD = nvl(null,:C.FREIGHT_CD) ;
  21.              WHERE SHIPVIA_CD = nvl(null,:C.SHIPVIA_CD) ;
  22.              WHERE cust_no = nvl(null,:C.billto_cd) ;
  23.              WHERE TERMS_CD = nvl(null,:C.TERMS_CD) ;
  24.              WHERE cust_no = nvl(null,:C.billto_cd) ;
  25.              WHERE HOLD_CD = nvl(null,:C.HOLD_CD) ;
  26.              WHERE status_code = nvl(null,:C.order_status) ;
  27.              
  28. If I understand the "nvl" function then the following expression from the 
  29. first where clause
  30.  
  31.             nvl(null,:c.cust_no) 
  32.             
  33. means if null is equal to null then return the value of bind variable 
  34. ":c.cust_no"  which happens to be a screen variable.  This means the 
  35. expression will always return the value of ":c.cust_no".  Is there any 
  36. performance reason to do this?  I would think this would actually slow the 
  37. form down.  But the forms which came with the package have this type of 
  38. expression in a lot of places.  
  39.  
  40. Thanks!
  41.