Unix Technical Forum

Select UNICODE (UTF8) data as octets from database Options

This is a discussion on Select UNICODE (UTF8) data as octets from database Options within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi. My database (10g) has been created with database character set to "Unicode standard UTF-8 AL32UTF8". The data has ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 12:37 PM
OracleServer
 
Posts: n/a
Default Select UNICODE (UTF8) data as octets from database Options

Hi.
My database (10g) has been created with database character set to
"Unicode standard UTF-8 AL32UTF8".

The data has been stored correctly. Used select dump(name, 1016)
from...
Query returned:
Len = 3 CharacterSet=AL32UTF8: e4, b8, 84
UTF-8 encoding of Unicode character (Traditional Chinese): 丁


Can someone tell me how to select this col into a ProC VARCHAR2
variable? The query in my ProC code returns this a value, but the
lenght is equal to 1. How can I get all the 3 octets into my VARCHAR2
variable?
Does it depends on any compilation option, or the PC locale?


BR,
Helge Hauan

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 12:37 PM
Mark D Powell
 
Posts: n/a
Default Re: Select UNICODE (UTF8) data as octets from database Options

On Apr 18, 6:30*am, OracleServer <helge.ha...@applica.no> wrote:
> Hi.
> My database (10g) has been created with database character set to
> "Unicode standard UTF-8 AL32UTF8".
>
> The data has been stored correctly. Used select dump(name, 1016)
> from...
> Query returned:
> Len = 3 CharacterSet=AL32UTF8: e4, b8, 84
> UTF-8 encoding of Unicode character (Traditional Chinese): 丁
>
> Can someone tell me how to select this col into a ProC VARCHAR2
> variable? The query in my ProC code returns this a value, but the
> lenght is equal to 1. How can I get all the 3 octets into my VARCHAR2
> variable?
> Does it depends on any compilation option, or the PC locale?
>
> BR,
> Helge Hauan


Is length returning bytes or characters? Dump returns internal
storage.

>From the SQL manual >>

The "length" functions return the length of char. LENGTH calculates
length using characters as defined by the input character set. LENGTHB
uses bytes instead of characters. LENGTHC uses Unicode complete
characters. LENGTH2 uses UCS2 codepoints. LENGTH4 uses UCS4
codepoints.
<<

HTH -- Mark D Powell --

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 12:42 PM
OracleServer
 
Posts: n/a
Default Re: Select UNICODE (UTF8) data as octets from database Options

On 18 Apr, 20:35, Mark D Powell <Mark.Pow...@eds.com> wrote:
> On Apr 18, 6:30*am, OracleServer <helge.ha...@applica.no> wrote:
>
>
>
>
>
> > Hi.
> > My database (10g) has been created with database character set to
> > "Unicode standard UTF-8 AL32UTF8".

>
> > The data has been stored correctly. Used select dump(name, 1016)
> > from...
> > Query returned:
> > Len = 3 CharacterSet=AL32UTF8: e4, b8, 84
> > UTF-8 encoding of Unicode character (Traditional Chinese): 丁

>
> > Can someone tell me how to select this col into a ProC VARCHAR2
> > variable? The query in my ProC code returns this a value, but the
> > lenght is equal to 1. How can I get all the 3 octets into my VARCHAR2
> > variable?
> > Does it depends on any compilation option, or the PC locale?

>
> > BR,
> > Helge Hauan

>
> Is length returning bytes or characters? *Dump returns internal
> storage.
>
> >From the SQL manual >>

>
> The "length" functions return the length of char. LENGTH calculates
> length using characters as defined by the input character set. LENGTHB
> uses bytes instead of characters. LENGTHC uses Unicode complete
> characters. LENGTH2 uses UCS2 codepoints. LENGTH4 uses UCS4
> codepoints.
> <<
>
> HTH -- Mark D Powell --– Skjul sitert tekst –
>
> – Vis sitert tekst –


Hi again.
What I want is to get all the octets that represents the character(s)
selected into a Pro*C variable. Do You know how to do it?

/Helge

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:06 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com