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: Srinivasan Subramanian kandallu <srinivasan.kandallu_at_wipro.com>
Date: Mon, 4 Sep 2000 17:32:19 +0530
Message-Id: <10609.116146@fatcity.com>


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-----
From: root_at_fatcity.com [mailto:root_at_fatcity.com]On Behalf Of John Dunn Sent: Monday, September 04, 2000 2:23 PM To: Multiple recipients of list ORACLE-L Subject: oracle Pro C question

> -----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).
Received on Mon Sep 04 2000 - 07:02:19 CDT

Original text of this message

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