On 2006.04.07, Mark Aufflick <[EMAIL PROTECTED]> wrote:
>
> Although that's not a dissimilar problem to the NULL as empty string
> issue in the Oracle C libraries (which really really bites).
Um, where are you getting this information from? Oracle's OCI libraries
definitely expose whether a column in a resultset is an empty string or
a NULL through an "is null" kind of boolean. So, if you ignore that
boolean, then yes: a NULL appears to be an empty string. But, if you
care to tell the difference apart, you can.
See: (Requires Oracle TechNet login.)
http://download-west.oracle.com/docs/cd/A87860_01/doc/appdev.817/a76975/oci15rel.htm#449815
http://download-west.oracle.com/docs/cd/A87860_01/doc/appdev.817/a76975/oci02bas.htm#422173
The "indicator variable" parameter (indp) -- look at the second URL,
Table 2-8 "Output Indicator Values":
-2 The length of the item is greater than the length of the output
variable; the item has been truncated. Additionally, the
original length is longer than the maximum data length that can
be returned in the sb2 indicator variable.
-1 The selected value is null, and the value of the output variable
is unchanged.
0 Oracle assigned an intact value to the host variable.
>0 The length of the item is greater than the length of the output
variable; the item has been truncated. The positive value
returned in the indicator variable is the actual length before
truncation.
So, if the indicator variable is set to -1, the value is NULL, even if
the output variable (the column value) is an empty string.
Now, whether the AOLserver ns_db interface bubbles up that NULL
information back to the application code ... that's a different story,
but this isn't a limitation of Oracle's OCI library, but rather
AOLserver's ns_db interface.
-- Dossy
--
Dossy Shiobara | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network | http://panoptic.com/
"He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]>
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.