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: substr, substrb and raw datatype

Re: substr, substrb and raw datatype

From: Rafal Dabrowa <rdsbrows_at_poczts.onet.pl>
Date: Tue, 14 Jun 2005 22:38:11 +0200
Message-ID: <d8nfh5$nlu$1@nemesis.news.tpi.pl>


HansF wrote:
> On Tue, 14 Jun 2005 20:34:57 +0200, Rafal Dabrowa interested us by

>>inconsistent with behavior of length/lengthb function pair.
>>Both functions return the same value for raw fields.

>
> Assuming your database/session is set to a single byte character set (and
> assuming this will influence the results) length() and lengthb() should
> provide the same result - one character = one byte.

But, for a 10-byte RAW value, both length and lengthb return 20. Although, lengthb works on a byte-oriented string, like substrb does. So, if substrb does not perform a conversion, lengthb shouldn't, too. If lengthb wouldn't perform a conversion, it would return 10, not 20.

-- 
Rafal

sed -e s/s/a/g <my_address >my_right_address
Received on Tue Jun 14 2005 - 15:38:11 CDT

Original text of this message

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