Re: Oracle Pro C problem

From: Jodi Showers <jshowers_at_cmi.on.ca>
Date: Mon, 19 Dec 1994 19:36:52 GMT
Message-ID: <jshowers-1912941433140001_at_mac25.cmi.on.ca>


In article <D0vAwz.IEr_at_world.std.com>, cbarr_at_world.std.com (Chris Barr) wrote:

> Jorn Horvik (jornh_at_albatross.no) wrote:
> : When I retrieve character strings from the database, the strings are
> : padded with blanks. This makes string comparision a bit difficult.
 

> : The question is does anyone know how to avoid the strings being padded
> : with blanks?

Jorn.

ANSWER: use Pro*C VARCHARS and Database column type VARCHAR2's.

Char datatypes are compared (as you said) with blank padded semantic comparision rules.

Varchar's use a non blank padded approach.

I've found it best to stick with VARCHAR's for all character manipluations.

> If padded with blanks, does the Pro*C length value include the suffixed
> space chars?
>
> If you're already using Pro*C, and evaluation of the 3 char datatypes
> don't help (char, varchar, varchar2), I'd just write a little routine
> to copy them. it can be done efficiently.

I don't know where you got this idea from chris, there is NO varchar2 Pro*C type.
VARCHAR2 is only oracle database column data type.

>
> - C.
> --
> - Chris

Jodi. Received on Mon Dec 19 1994 - 20:36:52 CET

Original text of this message