Re: Assigning NULL value in PRO*C

From: Jack A. Rabah <jack_at_idsintl.com>
Date: 1999/03/26
Message-ID: <7dgjoc$6bh$1_at_nnrp1.dejanews.com>#1/1


Hi,

I realize using indicators is the easiest way of handling nulls, but I would have to declare indicator variables for every structrue. I am trying to see if I can avoid using indicators since that involves many changes to the code I'm porting. In the ESQLC (Informix) code an initialization function sets every field in the structure to null using:

DB_NULL_STRING (ptr->prog_desc);

where DN_NULL_STRING is defined as:

#define DB_NULL_STRING(X) rsetnull(CSTRINGTYPE,(char*)X);

rsetnull() and risnull() are provided by the informix esqlc library. Are there any similar functions in PRO*C? Do I need to initialize the structure in the first place or does PRO*C handle that?

later,
jack

In article <7dedi0$l5$3_at_news8.svr.pol.co.uk>,   "Gerrit-Jan Linker" <gjlinker_at_litconsulting.freeserve.co.uk> wrote:
> Hi,
>
> Look in the precompiler manual for indicater variables. What they basically
> do is fetch another value from Oracle with which you can determine null
> values. From the top of my head:
>
> select comm:id from emp
>
> if id = -1 then comm is null otherwise comm is not null.
>
> Regards, Gerrit-Jan Linker
> Developer of OraCodes, OraSQL, Oraxcel and OraWeb
> http://members.aol.com/gjlinker
>
> jack_at_idsintl.com wrote in message <7d95i9$n3d$1_at_nnrp1.dejanews.com>...
> >Hi,
> >
> >I am working on porting an application from Informix to Oracle. The code is
> >written in embeded SQL (ESQL). In the Informix code risnull() rsetnull()
 are
> >used to initialize a C structure with NULL values and to check for NULL
> >values. Are there any similar function calls in PRO*C? I know you can use
> >indicators to achieve this, but that implies major changes to the code I'm
> >working with. Any ideas?
> >
> >later,
> >jack
> >
> >-----------== Posted via Deja News, The Discussion Network ==----------
> >http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
>

---
Jack A. Rabah
IDS Software Systems
jack_at_idsintl.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    
Received on Fri Mar 26 1999 - 00:00:00 CET

Original text of this message