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 18:52:37 +0200
Message-ID: <d8n2a6$cor$1@nemesis.news.tpi.pl>


DA Morgan wrote:
> SQL> CREATE TABLE t (
> 2 charcol VARCHAR2(20),
> 3 rawcol RAW(20));
>
> Table created.
>
> SQL> INSERT INTO t VALUES ('ABC', 'ABC');
>
> 1 row created.
>
> SQL> COMMIT;
>
> Commit complete.
>
> SQL> SELECT DUMP(charcol), DUMP(rawcol)
> 2 FROM t;
>
> DUMP(CHARCOL) DUMP(RAWCOL)
> ---------------------- ---------------------
> Typ=1 Len=3: 65,66,67 Typ=23 Len=2: 10,188

But I have asked for differences between substr and substrb function on raw datatype. Why these functions give different results on the same data:

   sql> select substr(val, 5,2), substrb(val, 5, 2) from xyz;

   SU SUBS

Although on table with varchar2 datatype they give the same result:

   sql> desc zyx
    Name Null? Type

   sql> select substr(val, 5,2), substrb(val, 5, 2) from zyx;

   SU SU

-- 
Rafal

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

Original text of this message

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