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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Null handlings in Pro*C

RE: Null handlings in Pro*C

From: Cale, Rick T (Richard) <RICHARD.T.CALE_at_saic.com>
Date: Tue, 23 May 2000 04:29:28 -0700
Message-Id: <10506.106346@fatcity.com>


Here is an partial example on indicator variables.

EXEC SQL BEGIN DECLARE SECTION;

int      field1;
int      field2;

short iv_field1;
short iv_field2;
EXEC SQL END DECLARE SECTION; EXEC SQL EXECUTE
BEGIN
   SELECT field1, field2
   INTO :field1:iv_field1,

            :field2:iv_field2
   FROM table;
END;
END-EXEC; Rick
> -----Original Message-----
> From: raman.yagna_at_db.com [SMTP:raman.yagna_at_db.com]
> Sent: Tuesday, May 23, 2000 3:09 AM
> To: Multiple recipients of list ORACLE-L
> Subject: RE: Null handlings in Pro*C
>
> hi rick,
> Thanks for the answer . But my question was how to use indicator
> variables inside a plsql block inside a Pro*C
> program . Or is there any other way . Thanks once again.
>
> Regards,
> Raman
>
> ---------------------------------------- Message History
> ----------------------------------------
>
>
>
> Please respond to ORACLE-L_at_fatcity.com
>
> To: ORACLE-L_at_fatcity.com
> cc:
>
>
>
> In Pro*C you assign to indicator variables by
> FETCH cursor_name INTO
> :variable_name:indicator_variable_name
>
> Rick
>
> > -----Original Message-----
> > From: raman.yagna_at_db.com [SMTP:raman.yagna_at_db.com]
> > Sent: Monday, May 22, 2000 5:34 AM
> > To: Multiple recipients of list ORACLE-L
> > Subject: Null handlings in Pro*C
> >
> > Hi gurus,
> > Sorry for posting this question again . Can anyone help me in this
> > regard .
> >
> > Regards,
> > Raman
> >
> >
> > ---------------------- Forwarded by Raman Yagna on 22/05/2000 16:22
> > ---------------------------
> >
> >
> > To: ORACLE-L_at_fatcity.com
> > cc:
> > Subject:
> >
> > How to handle the indicator variables in a pl/sql block inside a Pro*C
> > program. If we are using a select into or Fetch into then along with the
> > host variable the indicator variable can be placed. But if the value is
> > getting assigned to the host variable using an assignment statement ,
> then
> > how to put the indicator variable.
> >
> > Please take the following example how the indicator variable can be put
> > inside the PL/SQL block.
> >
> > main()
> > {
> > EXEC SQL BEGIN DECLARE SECTION;
> >
> > varchar salary[20];
> > short ind_var;
> >
> > EXEC SQL END DECLARE SECTION;
> >
> > EXEC SQL EXECUTE
> > DECLARE
> > l_tab_sal varchar2(20);
> > BEGIN
> >
> > Here I call a pl/sql block with the paramters and out value as
> > l_tab_sal;
> >
> > if l_tab_sal is null this is giving 1405 error . I can handle by
> > specifying nvl but i want to handle thru indicator variables inside
> > plsql block .
> >
> > :salary := l_tab_sal; /* HOW TO ASSIGN INDICATOR VARIABLE HERE */
> >
> > END;
> > END EXEC;
> >
> > salary[salary.len] = '\0';
> > printf ("value is %s", salaray.arr);
> > }
> >
> > Raman
> >
> >
> > --
> > Author:
> > INET: raman.yagna_at_db.com
> >
> > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> > San Diego, California -- Public Internet access / Mailing Lists
> > --------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from). You may
> > also send the HELP command for other information (like subscribing).
>
> --
> Author: Cale, Rick T (Richard)
> INET: RICHARD.T.CALE_at_saic.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
>
>
>
> --
> Author:
> INET: raman.yagna_at_db.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
Received on Tue May 23 2000 - 06:29:28 CDT

Original text of this message

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