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: oracle Pro C question

RE: oracle Pro C question

From: Cale, Rick T (Richard) <RICHARD.T.CALE_at_saic.com>
Date: Tue, 5 Sep 2000 03:59:16 -0700
Message-Id: <10610.116190@fatcity.com>


I am not aware of anyway to have the c variable automatically null terminated. I 'd be curious to
know if mode=.. works. After you do a select ...into or fetch into a C variable you would NULL terminate by
c_variable[oracle_variable.len]='\0';

Rick

> -----Original Message-----
> From: Srinivasan Subramanian kandallu [SMTP:srinivasan.kandallu_at_WIPRO.COM]
> Sent: Monday, September 04, 2000 9:02 AM
> To: Multiple recipients of list ORACLE-L
> Subject: RE: oracle Pro C question
>
> If your table has a column of width 200, in ur pro*c program, you should
> always declare variable of size+1,ie.,in ur case it should be declared as
> char mystring[201].
>
> Null termination is depend on the compilation parameters you use, like
> mode=ansi/oracle etc
>
> Srini
>
> -----Original Message-----
> Sent: Monday, September 04, 2000 2:23 PM
> To: Multiple recipients of list ORACLE-L
>
>
>
>
> > -----Original Message-----
> > From: Jamie Pearce
> > Sent: 01 September 2000 17:25
> > To: John Dunn
> > Subject: oracle question
> >
> > Can you post this piss easy question to your Oracle group - I've wasted
> > too much time trying to do it.
> >
> > I have an Oracle field on a table defined as VARCHAR2(200) and a C host
> > variable defined as char mystring[200].
> >
> > How do I select the oracle field in to the C host variable so that a
> null
> > character automatically gets appended to the string?
> > e.g. if the Oracle field contained "hello" then the C host variable
> would
> > contain "hello\0" with no extra blanks?
> >
> --
> Author: John Dunn
> INET: john.dunn_at_sefas.co.uk
>
> 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: Srinivasan Subramanian kandallu
> INET: srinivasan.kandallu_at_wipro.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).
Received on Tue Sep 05 2000 - 05:59:16 CDT

Original text of this message

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