Re: Pro*C Indicator Variables (bug?)

From: <jschmidt_at_connect.net>
Date: Sat, 03 Dec 94 20:59:04
Message-ID: <3br8cf$cbh_at_dallas1.connect.net>


In article <3alno0$md3_at_epicycle.lm.com>, <kao_at_etgroup.com> writes:
> Path:

news.connect.net!news.sprintlink.net!howland.reston.ans net!news.cac.psu.edu!news.pop.psu.edu!hudson.lm.com!ep icycle.lm.com!not-for-mail
> From: Keith A. Overstreet <kao_at_etgroup.com>
> Newsgroups: comp.databases.oracle
> Subject: Pro*C Indicator Variables (bug?)
> Date: 19 Nov 1994 15:38:24 -0500
> Organization: Enterprise Technology Group, Inc.
> Lines: 22
> Sender: kao_at_telerama.lm.com
> Message-ID: <3alno0$md3_at_epicycle.lm.com>
> NNTP-Posting-Host: epicycle.lm.com
> X-Newsreader: TIN [version 1.2 PL2]
>
> We're moving from 1.3 to 1.5 of Pro*C.
>
> The Pro*C manual says that "When MODE=ORACLE, ORACLE
 does not
> issue and error if you SELECT or FETCH a null into a
 host
> variable that is not associated with an indicator
 variable."
>
> That would seem to contradict the error message that
 we
> are getting (i.e. ORA-01405: fetched column value is
 NULL").
>
> This only occurs if you have used an indicator
 variable on
> one of the variables in the select. It seems that if
 you
> use no indicator variables, it works fine. But if
 you
> use one, you have to do them all.
>

You've answered your own question. ORACLE is what ORACLE does, the manual be damned. We always use indicator values on host variables and load the data into C data structures.

For textual information we indicate
the "NULLNESS" of a variable by setting the first byte of the character array to '\0'; For numeric or raw information the indicator is always used; the only time this contains superfluous information is when the column is constrained such that null values on not possible. This may seem like a great deal of extra coding, but 99% of our PRO*C is generated by pcg (pro*c generator) so its no skin off of our back. Received on Sat Dec 03 1994 - 20:59:04 CET

Original text of this message