Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: VARCHAR2 in Pro*C
Make sure you declared the oracle variable as a varchar2 and not a char or char *. The data is put into the .arr structure member and the length is in the .len member. This should work just fine.
Thomas Booker wrote:
>
> I am using Pro*C to select a group of rows from Oracle. One of the
> columns is a VARCHAR2, with data varying in length from 1 character
> to 550 characters. When I select the column in OCI, the program returns
> only
> the text of the string in the column, no extra spaces. When I select
> the column
> in Pro*C, it pads the column out to 550 spaces, regardless of how long
> the
> actual string is.
>
> Is there an easy way around this? I tried RTRIM() to get rid of the
> padded
> spaces, but that didn't help. I only want the text in the column, not
> extra
> spaces at the end.
>
> Any help would be appreciated.
>
> Thanks in advance.
>
> - Tom Booker (booket01_at_mchip00.med.nyu.edu)
-- --- Allen Kirby AT&T ITS Production Services akirby_at_att.com Alpharetta, GA.Received on Wed Apr 23 1997 - 00:00:00 CDT