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