Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: substr, substrb and raw datatype
Rafal Dabrowa wrote:
> 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
The point I was trying to make, perhaps too subtly, was that you should not be using RAW for character data. Hans stated exactly that with far more clarity.
In my example above the string 'ABC' is stored as 65,66,67 so substringing might return 65,66.
What do you expect to get, even if SUBSTR did work, with 10,188? the 10 or the 188? Neither is a letter.
-- Daniel A. Morgan http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Tue Jun 14 2005 - 23:58:45 CDT