473,383 Members | 1,792 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,383 software developers and data experts.

INSERT Through Pro*C in UTF 8 DB

Hi,

I have a table that contains a huge number of fields, out of which
3 are VARCHAR2(2000). I am using a Orcale 9i with UTF8 char set. The
data I am trying to insert is ASCII (English). When I try using a
Pro*C program to insert the data, it fails, giving the error
ORA-01461.
My data is not longer than 2000 char. It neither contains any
multibyte character. Why does this happen?

If I try to insert one of the 3 VARCHAR2 columns only, it works fine.

If I use the same Pro*C program to insert the same data into the same
table in non-UTF8 database, it inserts perfectly.

Incidently, I tried changing the columns from VARCHAR2(2000) to CLOB.
Then the program works fine.

Do I need to use CLOB? As long as my data contains single byte
characters, why should I increase my column length?

Thanks in advance.

- Anoop
Jul 19 '05 #1
1 5393
Anoop wrote:
Hi,

I have a table that contains a huge number of fields, out of which
3 are VARCHAR2(2000). I am using a Orcale 9i with UTF8 char set. The
data I am trying to insert is ASCII (English). When I try using a
Pro*C program to insert the data, it fails, giving the error
ORA-01461.
My data is not longer than 2000 char. It neither contains any
multibyte character.
Are you sure about that? Any non-7 bit ASCII character could be
interpreted as multibyte character.

BTW - use varchar2(2000) CHAR as definition. The default is BYTE.
If this change makes your problem disappear, you had "extended ASCII"
characters, that are actually multibyte in UTF.

Why does this happen?
If I try to insert one of the 3 VARCHAR2 columns only, it works fine.

If I use the same Pro*C program to insert the same data into the same
table in non-UTF8 database, it inserts perfectly.

Incidently, I tried changing the columns from VARCHAR2(2000) to CLOB.
Then the program works fine.

Do I need to use CLOB? As long as my data contains single byte
characters, why should I increase my column length?


All points to the fact you may have multibyte characters (which
cold be single byte in, say WE8MSWIN1252)
--

Regards,
Frank van Bortel

Jul 19 '05 #2

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

Similar topics

24
by: CJM | last post by:
I have the following SP: CREATE PROCEDURE Orders_CreateOrder @CustomerID int, @LocationID int, @CustOrderNo varchar(20), @OrderDate smalldatetime AS Insert into Orders (CustomerID,...
0
by: Oliver G | last post by:
Hello, we have Problems to recompile a old Version of a Serviceprogramm written in Visaul C++ 6. Now we have a 9.2.0.1.0 DB with a VS.NET 2003. All we wanna do is call a Procedure with an insert...
2
by: Display Name | last post by:
I can't insert an image using the "add a new stylesheet" function- the function, on dreamweaver MX (i'm on Windows 2k Pro) seems to work as it generates the code... but the image never shows up in...
2
by: Peter Parker | last post by:
Hi All, I'm going to be doing some .net development work on Windows XP Pro for the first time, having done all my work so far on Windows 2000 Advanced Server. Are there any restrictions on .net...
11
by: Sezai YILMAZ | last post by:
Hello I need high throughput while inserting into PostgreSQL. Because of that I did some PostgreSQL insert performance tests. ------------------------------------------------------------ --...
4
by: souravmallik | last post by:
Hello, Is there any way to improve performance of an after insert trigger in bulk insert. I have a pro*c program that insert data in a stagging table in bulk insert mode. From stagging table I...
8
by: CaptainCrazyHat | last post by:
Greetings! I currently have a table named 2008-01-30. I would like to insert a new field, and I would like that field to be in a Date format and have it populated with the table name. I'll be...
1
by: Anoop | last post by:
Hi, I have a table that contains a huge number of fields, out of which 3 are VARCHAR2(2000). I am using a Orcale 9i with UTF8 char set. The data I am trying to insert is ASCII (English). When I...
3
by: Kunal Desale | last post by:
Hi, How to insert/update data in foxpro table field having datatype MEMO using Linked Server? I have written sql insert queries in which i have used linked server to insert data into foxpro...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.