Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: problem about varchar
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.