Re: Strange(?) behaviour with utl_raw.cast_to_raw

From: Steve Baldwin <stbaldwin_at_multiservice.com>
Date: Tue, 21 Jul 2015 12:57:10 +1000
Message-ID: <CAC-6Hs0pDaw6Zq+2kcOXMNzgUoVq-HwQE5FxchDXgrANuniQHg_at_mail.gmail.com>



The database character set is utf8 ...

SQL> select value from nls_database_parameters where parameter = 'NLS_CHARACTERSET'; VALUE



AL32UTF8 SQL> create table sb1 (c1 raw(32));

Table created.

SQL> insert into sb1 values (utl_raw.cast_to_raw('abc'));

1 row created.

SQL> select length(c1), dump(c1) as dump_c1 from sb1;

LENGTH(C1) DUMP_C1

---------- ------------------------------
 6 Typ=23 Len=3: 97,98,99

On Tue, Jul 21, 2015 at 12:46 PM, <subodh.chhabra_at_outlook.com> wrote:

> Can you check NLS settings
>
>
>
> On Mon, Jul 20, 2015 at 7:39 PM -0700, "Steve Baldwin" <
> stbaldwin_at_multiservice.com> wrote:
>
> Is this expected behaviour?
>
> SQL> select length(utl_raw.cast_to_raw('abc')) from dual;
>
> LENGTH(UTL_RAW.CAST_TO_RAW('ABC'))
> ----------------------------------
> 6
>
> SQL> select dump(utl_raw.cast_to_raw('abc')) from dual;
>
> DUMP(UTL_RAW.CAST_TO_RAW('ABC'))
>
> --------------------------------------------------------------------------------
> Typ=23 Len=3: 97,98,99
>
> I was expecting the first select to return a length of 3 - just like the
> dump in the second select.
>
> (Oracle 11.2.0.4)
>
> Thanks,
>
> Steve
>
> ------------------------------------------------------------------
> This email is intended solely for the use of the addressee and may
> contain information that is confidential, proprietary, or both.
> If you receive this email in error please immediately notify the
> sender and delete the email..
> ------------------------------------------------------------------
>
>

-- 


------------------------------------------------------------------
This email is intended solely for the use of the addressee and may
contain information that is confidential, proprietary, or both.
If you receive this email in error please immediately notify the
sender and delete the email..
------------------------------------------------------------------


--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jul 21 2015 - 04:57:10 CEST

Original text of this message