Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Determining if fetched data is NULL using Method 4
Whenever I used Oracle queries that could return nulls, I always used Indicator variables. The code would look like: select x into results:results-indicator.
Then I'd define constants in the code for the indicator status (null-value) or ok-value. This was in Pro*cobol or PRO*C. It worked fine like that. Otherwise, I'd wrap an NVL around it (if it didn't really matter), like a Text field that was going to be output, and the blank results wouldn't effect anything. Anything important, where I HAD to know if it was null, I used an Indicator.
<jgaiche_at_my-deja.com> wrote in message news:8uen6m$46i$1_at_nnrp1.deja.com...
> Does anyone know how to determine if data that has been fetched from
> Oracle using Method 4 dynamic sql is Null. I am using method 4 to
> fetch a block of data into a host array. I then iterate thru the array
> and process the data. In the Oracle examples, sqlnul() is used to
> reset the Null/Not Null allowed bit before reallocating memory as
> required by the query....But....I cant find a way to determine if a
> field contained a null for a particular field in a record record after
> it has been fetched. It appears that when coercing to an int or float
> that the result is not always 0 when a null value is encountered. Any
> suggestions would be greatly appreciated!
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Sun Nov 12 2000 - 14:59:56 CST
![]() |
![]() |