Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: problem about varchar

Re: problem about varchar

From: Mark D Powell <mark.powell_at_eds.com>
Date: 14 Jan 2002 06:56:06 -0800
Message-ID: <178d2795.0201140656.6a24454b@posting.google.com>


cdior_at_sina.com (kevin Hanson) wrote in message news:<3281d531.0201130353.259c851b_at_posting.google.com>...
> oracle says in pro*c program use varchar will return the actual size
> of data,but it's not true,am i wrong?

Kevin, there have been some bugs in pro*c, but in general yes the statement by Oracle that the actual data size worth of data is returned is true.

Varchar data goes into a structure that is basically a lenth field followed by the data field. Upon return and after checking the indicator byte to be certain a null was not returned it is the program's responsibility to null terminate the data value creating a valid C string:

varchar_structure.arr[varchar_structure.len] = '\0';

If this does not answer your question you should probably repost with more specific information about what kind of problem you are encountering and what kind of calls are being made.

Received on Mon Jan 14 2002 - 08:56:06 CST

Original text of this message

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