C datatypes VS Oracle datatypes

From: Tomas Zakrzewski <zakrzews_at_pegasus.montclair.edu>
Date: 1996/02/08
Message-ID: <zakrzews.823821161_at_pegasus.montclair.edu>#1/1


Hi!  

 I am new to Oracle.

I am programming in C using PRO*C.
I have problem to handle data retrieved from Oracle.

Example:      
     datatype in Oracle of the field is varchar2[5].
 

Retrieved data from Oracle are 5 characters long therefore they takes the whole space of the array. If I declare array size of 6 bytes then I can manipulate array with C library functions, but I can not update or insert back to Oracle that array. If I declare array of five bytes there is no problem with Oracle, but the string in C is not terminated by NULL.

How this problem is handled. Do I have to maintain two copies of each string in case I want to update the Oracle. (one of the same size and second 1 byte larger for NULL use in C).

Please share with your experience.

Thanks.

Tom Z.

.   Received on Thu Feb 08 1996 - 00:00:00 CET

Original text of this message