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: Mon, 22 May 2000 03:11:13 -0700
Message-Id: <10505.106200@fatcity.com>


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
Received on Mon May 22 2000 - 05:11:13 CDT

Original text of this message

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