Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: oracle Pro C question
You have to typedef a character array, then define the type in PRO*C then
declare the variable as the typedef'd type:
typedef char t_str201[201]; EXEC SQL TYPE t_str201 IS STRING(201) REFERENCE; t_str201 mystring;
If you define your bind variables as VARCHAR, you need to specify a length; as a char array, PRO*C does not append a '\0'.
Kevin
> >
> > 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).
Received on Tue Sep 05 2000 - 06:30:47 CDT
![]() |
![]() |