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

Home -> Community -> Usenet -> c.d.o.server -> Re: ProC fills varchar2 with blanks ???

Re: ProC fills varchar2 with blanks ???

From: Markus Schöpflin <schoepflin_at_ginit.de>
Date: 1997/06/27
Message-ID: <33B3714D.4051B182@ginit.de>#1/1

Allen Kirby wrote:

<snip>

> Use a datatype of VARCHAR (or VARCHAR2, I can't remember - look it up)
> and you will get the following: name.arr - character array containing
> the data selected, with no trailing spaces, and name.len, which contain=
 s
> the actual number of bytes put into name.arr, in this case 3. Use
> name.len to null terminate name.arr, and there you have it.
> (name.arr[name.len] =3D '\0';) Now use name.arr as a string.

Hmm, this is what my Pro*C manual states about VARCHAR2:

VARCHAR2
You use the VARCHAR2 datatype to store variable=96length character strings. The maximum length of a VARCHAR2 value is 64Kbytes.

=2E
=2E
=2E

On Output
Oracle returns the number of bytes specified for the output host variable, blank=96padding if necessary, then assigns the output value to the target host variable. If a null is returned, Oracle fills the host variable with blanks.
=2E
=2E
=2E

Markus Schoepflin                         www:   http://www.ginit.de
GINIT Gesellschaft fuer integrierte       email: schoepflin_at_ginit.de
Informationssysteme mbH                   phone: +49 721 9 66 81 67
Vincenz-Priessnitz-Str. 1                 fax:   +49 721 9 66 81 11
D-76131 Karlsruhe, Germany Received on Fri Jun 27 1997 - 00:00:00 CDT

Original text of this message

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