Use dbms_lob.loadfromfile to handle chinese character
Hello,
I have a database with NLS_LANG=TRADITIONAL CHINESE_HONG KONG.ZHT16BIG5
There is a table with clob type column.
I've tried to use dbms_lob.loadfromfile to load file content into the clob type column.
But the result is that no matter the file is english or chinese character, the column's content will become "monster".
Is there any method to solve this problem ?
Can anyone help ?
Rgds,
Edward
null
Hi, it's me again.
I just want to share my experience and hope that it can help someone and someone can help me !
I've created a database with UTF8 as my character set.
With session's character set = UTF8, when I tried to use dbms_lob.loadfromfile to load data into clob column from a file with chinese character content. What has been stored is "monster" character. I know that it's because bfile is with binary type and will not do character set conversion when loadfromfile is being used.
I've tried the other way, I use dbms_lob.read to read the file and use utl_raw to convert it to UTF8 character set and store it in a varchar2. It works !
But what I want is to store the chinese character into the clob column.
I've tried to use the following option but still fail :
- convert (it's seems that has no effect)
- utl_raw.translate (it always get oracle error, I've use this as : utl_raw.translate(RAW, 'UTF8', 'UTF8'))
- utl_raw.convert
Hope that some have experience can help me !
Rgds,
Edward
null
Similar Messages
-
Download data from db to CSV file and need to handle chinese character
Hi , all , I need to write to alow to export data from db to csv file, now the problem is some column is chinese character, in both db and web page it can dispaly the chinese, but in Csv I can't display chinese character, what should I do?
Thnak youHJava wrote:
I already have res.setCharacterEncoding("UTF-8"); in my servlet, and db
req.setCharacterEncoding("UTF-8");
Are you sure that you have set it on the response? You do not need to set it on the request. Have you read the article? Do you understand the world of characters? It look like you still don't understand it.
by the way, since csv is text file , how can I bold my University number??? in sb = new StringBuffer();
sb.append("University Number");Not possible with CSV since it is text/plain. Use real XLS if you want to add formatting to cells. -
Handling Chinese character in Oracle B2B
Hi B2B Gurus,
Can 10G B2B or 11G B2B handle chinese characters? One of our supplier posting the transactions with non english characters, but those alll are erroring out in B2B. Can B2B hanlde these characters?
Here is the example:
PID|F||||CORMORANT,IBM,1RU
N1|ST|Agility Hungary|93|C019~
N3|Sz?kesfeh?rv?r, 8000
N4|Aszalv?lgyi u.||5 |HU|93~
Here is the error from the log file.
Element N301 data type must be 'Alphanumeric'. Segment N3 is defined in the guideline at position 3700.{br}{br}This error was detected at:{br}{tab}Segment Count: 16{br}{tab}Element Position: 1 {br}{tab}Characters: 611 through 631
An invalid character was encountered in a data element.
Element N401 data type must be 'Alphanumeric'. Segment N4 is defined in the guideline at position 3800.{br}{br}This error was detected at:{br}{tab}Segment Count: 17{br}{tab}Element Position: 1 {br}{tab}Characters: 635 through 649=
An invalid character was encountered in a data element
Please help me in resolving this.
Regards
RAJHi Anuj,
No, we dont have any option such like that....(encoding)
Here are the parameters for File/FTP while configure delivery channel.
polling interval 1
base directory
sender cipher suites
receiver cipher suites
sender channel mask None
receiver channel mask None
receiver proxy host
receiver proxy port
receiver proxy username
receiver proxy password
receiver proxy auth type
receiver control port
receiver data port
receiver regular expression
receiver read only
receiver read ordered
receiver read ordered timestamp source
receiver read ordered timestamp format
receiver read ordered timestamp offset
receiver file minimum age(in ms) 0
filename format %FROM_PARTY%_%TIMESTAMP%.dat
directory name format
Transport Callout Class
Transport Callout Library
Transport Callout Properties
Transport Callout Timeout(in seconds) 30
Internal delivery channel filename format
Filename format separator
Directory name format separator
transfer mode
Enable Marker false
Archival directory /ftpdata/elshas1/avnt/archive/850/PO
is VAN Mailbox false
Clear command channel false
Preserve Filename false
Please help me in resolving this ?
Regards
RAJ -
Hi,
I have some problems on handling Chinese Character.
I pass Chinese words to CFC and then do the SELECT search in DB. However, I find it cannot find Chinese words correctly.
When I try to prompt ( alert(#trim(URLDecode(search_tenderee_name))#) ) the wordings retrieved in CFC, it shows me incorrectly word.
I use the following method to call CFC:
ColdFusion.navigate('cfc/control.cfc?method=loadNameListSelection&search_name='+escape(doc ument.getElementById('search').value),'tableList');
Can anyone help me to solve this problem?
P.S. I have also tried:
ColdFusion.navigate('cfc/control.cfc?method=loadNameListSelection&search_name='+document.g etElementById('search').value,'tableList');
alert(#trim(search_tenderee_name)#)
It also cannot prompt me the correct Chinese Character.no you can't if you have a US variant it has a language pack specific to north american region. you might be able to go to nokia care and ask them to install a language pack with Chinese language but make sure it also has other languages that you are likely to use . also it will cost you as it is not standard to switch language packs
You know what I love about you the most, the fact that you are not me ! In love with technology and all that it can offer. Join me in discovery.... -
How to handle Chinese on WL 6.0 sp1
Hi all,
I got a strange experience when i'm trying to handle chinese character in
JPS. I wrote a simple JSP (test.jsp) performing "FORM POST" to see whether i can
get the "right" chinese character after FORM POST. The program is written as below:
<%@ page info="test page" session="true" buffer="1024kb"
import="java.sql.*, java.util.*, java.lang.*" %>
<%
response.setContentType("text/html; charset=UTF-8");
try {
String s1a = request.getParameter("field1");
String s2a = request.getParameter("field2");
%>
<HTML>
<HEAD>
<TITLE>DUMMY No. 1 ^.^ </TITLE>
</HEAD>
<BODY>
<BR>~~FORM POST TESTING~~<BR>
<FORM name="frm1" action="test.jsp" method="post">
Field 1: <INPUT type="text" name="field1"><BR>
Field 2: <INPUT type="text" name="field2"><BR>
<INPUT type="submit"><BR>
</FORM>
<%=s1a%> || <%=s2a%>
</BODY>
</HTML>
<% } catch (Exception e) {
out.println("Error : " + e.getMessage());
%>
Everytime when i entered a chinese character, i got some strange character
or even nothing after FORM POST. Do you know why or could you advise me how to
fix it? I'm using Window 2000 professional english version, default locale is
Hong Kong, and WebLogic 6.0sp1.
Thanks in advance.
Regards,
Ralpho
Hi Ralpho,
check out
http://e-docs.bea.com/wls/docs60///adminguide/config_web_app.html#100357
, I think it should help.
Cheers,
Daniel
> -----Ursprüngliche Nachricht-----
> Von: Ralpho [mailto:[email protected]]
> Bereitgestellt: Donnerstag, 21. Juni 2001 04:16
> Bereitgestellt in: jsp
> Unterhaltung: How to handle Chinese on WL 6.0 sp1
> Betreff: How to handle Chinese on WL 6.0 sp1
>
>
>
> Hi all,
>
> I got a strange experience when i'm trying to handle
> chinese character in
> JPS. I wrote a simple JSP (test.jsp) performing "FORM POST"
> to see whether i can
> get the "right" chinese character after FORM POST. The
> program is written as below:
>
> <%@ page info="test page" session="true" buffer="1024kb"
> import="java.sql.*, java.util.*, java.lang.*" %>
> <%
> response.setContentType("text/html; charset=UTF-8");
>
> try {
> String s1a = request.getParameter("field1");
> String s2a = request.getParameter("field2");
> %>
>
> <HTML>
> <HEAD>
> <TITLE>DUMMY No. 1 ^.^ </TITLE>
> </HEAD>
> <BODY>
> <BR>~~FORM POST TESTING~~<BR>
> <FORM name="frm1" action="test.jsp" method="post">
> Field 1: <INPUT type="text" name="field1"><BR>
> Field 2: <INPUT type="text" name="field2"><BR>
> <INPUT type="submit"><BR>
> </FORM>
> <%=s1a%> || <%=s2a%>
> </BODY>
> </HTML>
> <% } catch (Exception e) {
> out.println("Error : " + e.getMessage());
> }
> %>
>
> Everytime when i entered a chinese character, i got some
> strange character
> or even nothing after FORM POST. Do you know why or could you
> advise me how to
> fix it? I'm using Window 2000 professional english version,
> default locale is
> Hong Kong, and WebLogic 6.0sp1.
>
> Thanks in advance.
>
> Regards,
> Ralpho
>
-
How to insert 10 files from a directory to database,can i use dbms_lob??
Hii
I want to load 10files in my local drive into a table...how to do this.I'm able to do this individually using dbms_lob.loadfromfile and bfil but ,I want to copy all the files i that drive at time to my table...Is there any way to do this..?Okay... Here is some sample code that will help you store the files in binary format into db tables.
create table t_blob(bid integer, blbdata blob);
select * from t_blob;
create or replace directory ext_tab_dir as 'C:\Oracle\ExtTab_Dir';
grant read, write on directory ext_tab_dir to priya;
declare
src_file bfile;
dest_file blob;
len_file pls_integer;
begin
src_file:=bfilename('EXT_TAB_DIR','XML.doc');
insert into t_blob values(1,empty_blob()) returning blbdata into dest_file;
select blbdata into dest_file
from t_blob
where bid=1 for update;
dbms_lob.fileopen(src_file,dbms_lob.file_readonly);
len_file:=dbms_lob.getlength(src_file);
dbms_output.put_line(len_file);
dbms_lob.loadfromfile(dest_file,src_file,len_file);
update t_blob
set blbdata = dest_file
where bid = 1;
dbms_lob.fileclose(src_file);
end;
/I haven't used the wrap utility yet, so not much hands on with it. I guess the wrap utility at the OS level. Not sure if it will work at SQL prompt. -
GUI Download Chinese Character to Excel gibberish character
Hi Experts,
I'm facing a problem where I'm using FM gui_download to save Chinese Character into Excel file.
Upon double click to open the excel file, funny character shows up.
But if I were to open the same file using a blank Ms Excel application (Go to File->Open->choose file),
Excel will prompt me to select a proper encoding (GB2312 in this case), and the Chinese character can be seen thereafter.
But, my user doesn't want to go through this.
I've browsed through the forum and someone has posted about this before and it's unanswered.
How to download the chinese character using GUI_DOWNLOAD - unanswered
And, Re: GUI_DOWNLOAD give 2 bytes for each chinese character - I need fixed len which is not related to my problem.
Below is my code:
DATA: lv_codepage TYPE cpcodepage,
lv_char_cpage TYPE abap_encod,
lv_encoding TYPE abap_encod.
Get Code Page for Chinese Character Spras = '1' or 'ZH'
CALL FUNCTION 'NLS_GET_FRONTEND_CP'
EXPORTING
langu = '1' " Chinese Simplified Table T002
fetype = 'MS' " Manufacturer is Microsoft Table TCP05
IMPORTING
frontend_codepage = lv_codepage
EXCEPTIONS
illegal_syst_codepage = 1
no_frontend_cp_found = 2
internal_or_db_error = 3
OTHERS = 4.
Conversion c(4) = n(10)
lv_char_cpage = lv_codepage.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = p_file
filetype = 'DAT' "tried ASC and not working as well
codepage = lv_char_cpage "8404 in this case tried 8400 and same result
replacement = '#'
write_field_separator = 'X'
TABLES
data_tab = i_data_cnvr "table content
fieldnames = i_data_head "table header
Please help. Does this has something to do with utf-8 encoding?
Thank you.
Thanks,
ZY SeeHi Nitesh,
Is there a way to check the Excel codepage? Do you mean by codepage = 936 for GB2312 encoding?
Anyway, this issue is fixed. Issue is related to unicode system.
Below codes for gui_download solved the problem.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
codepage = '4103'
replacement = '#'
write_field_separator = 'X'
write_bom = 'X'
TABLES
data_tab = i_data_cnvr
fieldnames = i_data_head
Codepage = 4103 for utf-16 Unicode system.
Write-bom = 'X' to write Byte-Order-Mark.
Thanks,
ZY See -
DBMS_LOB.loadfromfile don't work?
I have a word doc file, I write a stored proc using DBMS_LOB.loadfromfile to load it into a BLOB record.
-the DBMS_LOB.getlength successfully got the length
-but when I use form ole container to show it....the ole container show nothing.
-if I use initialize_container ... it works....why?
my stored proc :-
PROCEDURE XXinsert_file AS
lobd BLOB;
fils BFILE := BFILENAME('UPLOAD', 'A1.TXT');
length integer;
BEGIN
-- update ole_container set ole_content = empty_blob() where container_id = 'CH050100001';
SELECT ole_content INTO lobd FROM ole_container
WHERE container_id = 'CH050100001' for update;
dbms_lob.fileopen(fils, dbms_lob.file_readonly);
length := dbms_lob.getlength(fils);
dbms_lob.loadfromfile(lobd, fils, length);
update ole_container set file_length = length where container_id = 'CH050100001';
dbms_lob.fileclose(fils);
COMMIT;
END XXinsert_file;Forms wraps files in a larger structure before storing them as blobs. So in Forms you can only read files that were loaded through Forms, and using dbms_lob you can only read files that were loaded through dbms_lob.
-
Chinese Character Support On MediaSource Organi
Hi,
I have MP3 song with filename in Chinese characters. On my Windows XP, I can view the filename in Chinese character using Windows File Explorer. Even the ID Tag also no problem. But when I use MediaSource Organizer, all my chinese character MP3 filename displayed as rubbish. Is there anyway I can make MediaSource to display chinese character without resorting to third party software since by nati've, Windows XP support chinese character viewing features.
Thanks,Felixcaniggia wrote:
Hi guys. I'm using Win2000 version and it's diff. from XP.
Anyone can help on this? Thks!
You will need to install a language viewer. For example, to view Chinese/Korean/Janpanese, you can install NJ Star viewer. -
Storing chinese character in Oracle8i
Hi Sir,
How to use Oracle8i database to store chinese character?
Is there any setting on database side?
I'm using Oracle8i 8.1.5 currently.
Please advise.
Thanks.it's not the field type, it's the character encoding you need to change. Generally, you should make sure that the DB uses UTF-8 encoding for storage, the DB connector uses UTF-8 (although probably if the DB does), set the content type for the page to "text/html; charset=UTF-8" and when you process forms, call request.setCharacterEncoding("UTF-8") before doing any getParameter calls.
-
Flex support for writing pad ( inputing chinese character)
I design a web application that allow customer to input their
messages into the database.
If the input is via keyboard, it is no problem. But it does
not work if the customer is using writing pad for inputing chinese
character.
Does Flash support this, if it is, how ?
ThanksI'm sure there is a large part of the Mac market that couldn't care less about this, but for those who can use it it's a major reason for buying SL.
Actually I seen a fair amount of disappointment from people who found after buying SL that the trackpad character input feature is only available on a restricted number of machines, and some have felt misled by the advertising about it. Hopefully Apple will be able to expand its availability in the future.
I'd be curious what you find it most useful for: Input of text of some length into documents, emails, etc., or smaller tasks like looking up characters in dictionaries. -
does oracle database store chinese characters?
How do i generate XML file using PL/SQL that support chinese character?
will using XMLELEMENT work...? in that case.
Thankyou for your replies.I do not have any personal experience with this, but it should work in theory - XMLELEMENT code should not care what characters are being stored in the database. Perhaps others with more experience with using XMLELEMENT can comment.
Srini -
How to download the chinese character using GUI_DOWNLOAD
How to download the chinese character using GUI_DOWNLOAD from SAP 4.6c
Hi,
Make sure that the chinese font is installed in your system, because when you download in excel, the character formats are taken from the Frontend. For detail see the below thread.
[link1|Re: Download Chinese character]
Thanks,
Asit Purbey. -
Display Chinese Character jsp page by using UTF-8
hi all,
I have one jsp page have Chinese character, need to allow user input Chinese character into db, right now my situation is if I set <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> , the Chinese character in my jsp page I can't display correcly, but the inser is okI have to set encoding to big5, then I can't insert chinese character into my db correctly.
can I use UTF-8 to display my jsp page, which have Chinese Character in there?Thank you!Hi Niklas
thank you for the suggestion. somebody told me UTF-8 suppose work, only if you typing your Chiness character in UTF-8 formate, i don't know that is true or not, but that realy a challenge for me, I using jdbc , some time ago, and then stop, and on that period,if I got free time, I did try to learn some tutorials on struct, hibernate, like http://javaboutique.internet.com/tutorials/Struts/; http://courses.coreservlets.com/Course-Materials/struts.html
recently I need to deal with some online form , first I want to use struct, but I keep got forwad problem, I forget the detail error message, and found not place to ask questions, so , I pick jdbc again, so ,if you have some useful link in struct or a nice community for people to learn struct, I am look forward to
know that,
by the way I set *<meta http-equiv="Content-Type" content="text/html; charset=big5" /> in my jsp*
String dbURL="jdbc:mysql://localhost/survey?useBig5=true&characterEncoding=Big5"; in jdbc
keep UTF-8 setting in mysql, it looks solute the problem that I had, hope that can enhabce our knowledge in that
thank you for the help and wish good luck for future. -
Inserting Chinese character using sqlplus
I am not able to insert Chinese character using sqlplus .
Am getting disconnected when trying to insert.
with no error
message coming
is disconnected form oracle enterpise 10.2.0.2.0 with .. mining..
Please help.sql is simple insert statement
insert into t5(txt) values ('中中 中 中 中 中 中 中 中 中 ');
os is AIX
I wonder when i using sql developer I am able to insert.
regarding environmental variable , I am not setting any variable regarding NLS.
I simply connect sqlplus username/password
when I execute following statement
sqlplus disconnect without giving any error.
question is why sql developer is able able to insert and sqlplus not
Thanks for reply
Maybe you are looking for
-
Airport Extreme Poor WiFi Performance
I've been doing periodic bandwidth tests with speedtest.net for several years now. I have an account, so my results are saved. I do them from a Mac Mini and also from my iPad. The MacMini is hardwired to an Airport Extreme. The iPad is, of course, us
-
Is there any documentation which throws light on how data aggregation happens in data warehouse grooming? what algorithm exactly it follows in different aggregation type (raw, hourly, daily)? How exactly it picks up a specific data value during Hourl
-
Adding Transparency/alpha to Embedded Font
Hi guys, I have embedded a font type in my application. Its working fine inside a text area. Now i need to add 60% transparency to it. In fact I need multiple transparency levels. Like - 60 % transparency for TextARea 70% for WindowShade Header etc.
-
CS6 Indesign Crashes when doing specific tasks
I have just got the new CS6 Indesign on my brand new computer. Indesign seems to crash when I either package a file, place and image onto a page or create a pdf. Please help how to stop this from happening?
-
HT5012 Why can't I log onto my online banking after updating my software
Why can't I log into my online banking after updating my software on iphone5 and ipad