473,241 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

Convert between Charsets in a plsql stored procedure (ora10g)

Hello!

I have Oracle 10g using AL32UTF8 as internal charset.

I have a documents table where uploaded files (I'm using modplsql
web-gateway (release 8i)) are stored in a blob-column. I upload a
CSV-File to this table which is in ISO 8859-1 Charset.
I now need to convert this binary data (which is in fact all
character-data) into utf-8.

I'm currently using this self-written function to do the conversion:

FUNCTION converttoclob(
p_blob IN BLOB,
p_clob OUT CLOB)
RETURN PLS_INTEGER IS
t_dest_offset PLS_INTEGER := 1;
t_src_offset PLS_INTEGER := 1;
t_blob_csid NUMBER := s2o_lob.default_csid;
t_lang_context PLS_INTEGER := s2o_lob.default_lang_ctx;
t_warning PLS_INTEGER;
BEGIN
s2o_lob.createtemporary(p_clob, TRUE);
s2o_lob.converttoclob(
p_clob,
p_blob,
s2o_lob.lobmaxsize,
t_dest_offset,
t_src_offset,
t_blob_csid,
t_lang_context,
t_warning);
RETURN t_warning;
END;

When I do
converttoclob(t_blob, t_clob);
the umlauts and non us-ascii chars are getting converted to multibyte
chars. But however this is NOT UTF8. (I wasn't able to figure out what
encoding/charset the output is in) Also after this conversion
us-ascii-chars immediately following special chars (like german umlauts,
euro-sign, etc.) are sometimes stripped of or converted to odd
characters too.

I did not find any documentation further explaining the csid and
lang_context parameters, maybe I could solve my problem with these.
The second Problem is closely related:

I have a varchar2 variable with text including umlauts, special-chars,
etc. As the Database is AL32UTF8 the varchar2data is UTF8 too. I now
want this to be converted to ISO 8859-1 Charset which I will then
convert to blob (the data could be converted to blob in the process of
converting it to latin1 too) to encode it with base64 or
quoted-printable and send it via mail.

I don't have a clue here too..

Thx a lot for your Help!

regards,

Michael Postmann
Jun 27 '08 #1
0 3396

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: David | last post by:
I am learning plsql. I would like to run a stored procedure to calculate my bank account value by predicted 10% annual growth rate. Below is my plsql that is having problems. Your help is highly...
0
by: Anand | last post by:
Hi all, I have a requirement of - checking the syntax, compiling and executing the plsql files (procedures, functions, triggers etc) from a remote machine. I use JAVA for development and i had...
1
by: comavas | last post by:
This error occurs while I open the url to the plsql procudure: http://192.168.0.154:7777/pls/chwd/chwebown.helloworld PS: The compilation of this procedure was successful! ...
4
by: Rodusa | last post by:
I am having problem to apply updates into this function below. I tried using cursor for updates, etc. but no success. Sql server keeps telling me that I cannot execute insert or update from inside...
5
by: simon | last post by:
I have datetime variable: Datetime tsEndTime; Should I use (DateTime): tsEndTime=(DateTime)rdr.GetValue(15) or is better to use: tsEndTime=Convert.ToDateTime(rdr.GetValue(15))
15
by: marvado | last post by:
Hi, can I run phpinfo(); or any php code from an oracle plsql package using htp.p from the oracle web toolkit owa? what I need is to run any php code using htp.p() I might be missing...
0
by: tickle | last post by:
Need to convert this PL/SQL script to Dynamic SQL Method 2 * copybook - celg02u3.sql SIR 24265 * * updates dt_deny for all rows in * * ...
0
by: sybrandb | last post by:
"Jorge Pinto" <jorgep@sympatico.cawrote in message news:<L2HQa.3116$104.264170@news20.bellglobal.com>... utl_smtp is only a wrapper for a java procedure. Need I say more. And oh yes, you may need...
1
by: atp2k3 | last post by:
Hello all, I am new to convert PLSQL to TSQL. Any expertise in SQL, please help me to do convert the belowed PLSQL procedure to SP in SQL server. I really appreciate your time. Thanks in advance....
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.