473,657 Members | 2,594 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.createt emporary(p_clob , TRUE);
s2o_lob.convert toclob(
p_clob,
p_blob,
s2o_lob.lobmaxs ize,
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 3416

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

Similar topics

11
7781
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 appreciated. Thanks declare money number := 50000.00; year number := 1;
0
2191
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 tried using jdbc connection. CallableStatement stmt; :::::::::: stmt = connection.prepareCall("Begin ... end;"); //Anonymous procedure
1
5388
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! ------------------------------------------------------------------------ The error_log contains the following line:
4
9260
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 a function and it gives me an option that I could write an extended stored procedure, but I don't have a clue of how to do it. To quickly fix the problem the only solution left in my case is to convert this recursive function into one recursive...
5
18713
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
4173
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 something, in my oracle/apache/php configuration I can only run flat .php files from /htdocs but can't run any php from a plsql procedure to display on a browser with htp.p
0
2708
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 * * the removal_eligibility_link table for all persons * * in all stages associated with the victim who has * * has had a specific legal status change * EXEC SQL EXECUTE
0
1340
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 to check your DBA actually configured the java_pool_size, or he is going to be in for some nasty surprises. Sybrand Bakker Senior Oracle DBA
1
7054
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. ============================================== PROCEDURE SaveTestAs(P_ProgramID NUMBER, P_ProgramName VARCHAR2) IS
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8730
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1950
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1607
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.