Home » SQL & PL/SQL » SQL & PL/SQL » Multibyte character (Oracle 11G)
Multibyte character [message #616636] Thu, 19 June 2014 04:14 Go to next message
elaiyavel
Messages: 114
Registered: April 2008
Senior Member
Hi Team,

We have stored multibyte character data in our database columns.

We have a requirement to write these values to a fixed length file (position based). Since it is multibyte value, positions are getting extended and we cannot separate values at the right location.

Thanks,
Elaiyavel
Re: Multibyte character [message #616662 is a reply to message #616636] Thu, 19 June 2014 05:52 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

And? What do you expect from us?

Re: Multibyte character [message #616722 is a reply to message #616636] Fri, 20 June 2014 00:37 Go to previous messageGo to next message
elaiyavel
Messages: 114
Registered: April 2008
Senior Member
Is there a way to write these multi byte character values to a position based file ?
Re: Multibyte character [message #616727 is a reply to message #616722] Fri, 20 June 2014 00:56 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

How is this an Oracle question.
If you think "position" as "byte position" (and not "char position"), you can use a fixed-length character set then each character is in a fixed number of bytes.

[Updated on: Fri, 20 June 2014 00:57]

Report message to a moderator

Re: Multibyte character [message #616757 is a reply to message #616722] Fri, 20 June 2014 07:59 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
elaiyavel wrote on Fri, 20 June 2014 11:07
Is there a way to write these multi byte character values to a position based file ?


What's the issue with using the classical way of generating CSV file.
Re: Multibyte character [message #616758 is a reply to message #616727] Fri, 20 June 2014 08:00 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Could you, by any chance, show us what you mean by creating an example?
Re: Multibyte character [message #616764 is a reply to message #616758] Fri, 20 June 2014 08:24 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
Seems you are asking Michel.

Anyway, from documentation http://docs.oracle.com/cd/E11882_01/server.112/e16536/ldr_control_file.htm#i1005287:
Quote:
Multibyte fixed-width character sets (for example, AL16UTF16) are not supported as the database character set.
....
SQL*Loader supports multibyte fixed-width character sets (such as AL16UTF16 and JA16EUCFIXED) in the data file


Since question is not about loading, it is about generating a fixed-width data file. Seems like it needs a workaround outside Oracle. I don't know about how to achieve it.

[Updated on: Fri, 20 June 2014 08:25]

Report message to a moderator

Re: Multibyte character [message #616769 is a reply to message #616764] Fri, 20 June 2014 08:32 Go to previous messageGo to next message
elaiyavel
Messages: 114
Registered: April 2008
Senior Member
Yes Absolutely, for multi byte characters, some characters occupies addition space and columns are written to file beyond the allocated position.

Is there a way to convert multi byte characters to single byte and write to a file.

This will help in the case when writing to fixed length files.
Re: Multibyte character [message #616770 is a reply to message #616764] Fri, 20 June 2014 08:37 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Lalit Kumar B wrote on Fri, 20 June 2014 15:24

Seems you are asking Michel.

No, I'm not. Quick Reply says so, but I don't expect Michel to create an example for OP's problem.
Re: Multibyte character [message #616771 is a reply to message #616770] Fri, 20 June 2014 08:45 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

I'm sure you don't. Laughing

Re: Multibyte character [message #616772 is a reply to message #616769] Fri, 20 June 2014 08:49 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
elaiyavel wrote on Fri, 20 June 2014 15:32
Yes Absolutely, for multi byte characters, some characters occupies addition space and columns are written to file beyond the allocated position.

Is there a way to convert multi byte characters to single byte and write to a file.

This will help in the case when writing to fixed length files.


Quote:
Yes Absolutely, for multi byte characters, some characters occupies addition space and columns are written to file beyond the allocated position.


You're wrong, you can generate a file with Unicode with fixed-width charecter set.

Quote:
Is there a way to convert multi byte characters to single byte and write to a file.


Most likely you can generate a file with a proper 8-bit character set.

But as we don't know anything about your actual case we can't help more.
As Littlefoot asked you: post an example and specify with more details what you have and what you want.

[Updated on: Fri, 20 June 2014 08:49]

Report message to a moderator

Re: Multibyte character [message #616773 is a reply to message #616769] Fri, 20 June 2014 09:06 Go to previous message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
elaiyavel wrote on Fri, 20 June 2014 19:02
Yes Absolutely, for multi byte characters, some characters occupies addition space and columns are written to file beyond the allocated position.


You did not read the documentation link I provided above. It should remove all your confusions about character set.
Previous Topic: SQL or loops
Next Topic: SYSDATE Central to Eastern time
Goto Forum:
  


Current Time: Thu Apr 25 15:14:01 CDT 2024