Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: OCI question: about null string

Re: OCI question: about null string

From: Pablo Sanchez <pablo_at_dev.null>
Date: Fri, 29 Nov 2002 22:02:36 GMT
Message-ID: <Xns92D5990759C1Bpingottpingottbah@209.242.64.107>


jocave_at_yahoo.com (Justin Cave) wrote in
news:233b7a65.0211291353.3902e8f_at_posting.google.com:

> My guess is that you're not providing OCI with an indicator variable
> when you bind your char* buffer. This is the only way for OCI to
> tell you that you've fetched a NULL value (it doesn't change the
> data in the buffer you've passed in, so the buffer is likely to have
> garbage in it unless you've initialized it).

Justin is spot-on. Just a little clarification to the Oracle docs:

  1. If you do _not_ provide an indicator variable, you will get ORA-01405 on NULL values.
  2. If you do provide an indicator variable, you will _not_ get ORA-01405 on NULL values _and_ the indicator value will be set. -- Pablo Sanchez, High-Performance Database Engineering http://www.hpdbe.com
Received on Fri Nov 29 2002 - 16:02:36 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US