home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / database / oracle / 1499 < prev    next >
Encoding:
Internet Message Format  |  1992-09-04  |  1.7 KB

  1. Path: sparky!uunet!sun-barr!ames!purdue!yuma!csn!cherokee!windward!twood
  2. From: twood@windward (Tim Woodward)
  3. Newsgroups: comp.databases.oracle
  4. Subject: Re: Oracle Precompilers and Nulls
  5. Keywords: Precompiler Null
  6. Message-ID: <1992Sep4.143246.9870@advtech.uswest.com>
  7. Date: 4 Sep 92 14:32:46 GMT
  8. References: <Bu0zGv.941@mentor.cc.purdue.edu>
  9. Sender: news@advtech.uswest.com (Radio Free Boulder)
  10. Distribution: usa
  11. Organization: U S WEST Information Technologies
  12. Lines: 29
  13.  
  14. In article <Bu0zGv.941@mentor.cc.purdue.edu> coghawks@mentor.cc.purdue.edu (john) writes:
  15. >I recently happened into a problem using Pro-C with embedded SQL with
  16. >Nulls and comparison differences between = and IS (NOT) NULL.
  17. >It was when I had built a cursor which selected into a host variable,
  18. >which was then used as part of a selection criteria on the next
  19. >SQL statement. What occured was that when using the where clause
  20. >for ex. WHERE EMPD.DESCRIPT = :host_emp, if either value was null
  21. >then this never would return true or if they both were null
  22. >it still wouldn't be true.  So either I had to have 2 versions and check
  23. >explicitly if and when things were NULL before I use them in a WHERE 
  24. >clause,  or set them to a default value.  Which in oracle is syntactily
  25. >supported, but not implemented when declaring a table.  Another problem
  26. >with setting things to a default value is then building indexes etc..
  27. >those values are all grouped.  I am new at this and am looking forward
  28. >to any replies.
  29. >
  30. >Thank you
  31. >John Hawkins.
  32. >
  33.  
  34.     Use indicator variables to test for NULLS. 
  35.     Ex: WHERE (EMPD.DESCRIPT = :host_emp) OR ((EMPD.DESCRIPT is NULL)
  36.         AND (:host_emp:ind_host_emp IS NULL));
  37.         
  38.  
  39.  See Testing for NULLS in the MANUAL. 
  40.  
  41.  
  42.  Tim Woodward
  43.