ORA-01461 error in DB with char encoding = UTF8
Date: Sun, 17 Dec 2000 20:36:48 GMT
Message-ID: <At9%5.1702$gS.1790930_at_typhoon.ne.mediaone.net>
Hi all,
Configuration:
Weblogic 5.1 SP6
Windows 2000
Oracle 8.1.6
Oracle OCI drivers
Originally, we had the character encoding for our DB set to iso8859-1. Realizing that we'd need to store some international characters, we rebuilt the DB with character encoding = UTF8. After that, we started seeing the following exception,
[java.sql.SQLException: ORA-01461 : can bind a LONG value only for insert into a LONG column]
when we execute the PreparedStatement
when we switch back to iso8859-1, we no longer see this error.
Here is the definition of the table in question:
create table Event_Log (
id number(20), type varchar(25), time date, user_id number(20), firm_id number(20), marketspace_id number(20), object_id number(20), duration number(20), bytes number, string_info varchar(200)
);
And here is a code snippet showing how we execute the SQL:
sql.setLong(i++, id); sql.setString(i++, type.toString()); sql.setTimestamp(i++, millis); sql.setLong(i++, userId); sql.setLong(i++, firmId); sql.setLong(i++, marketSpaceId); sql.setLong(i++, objectId); sql.setString(i++, stringInfo); sql.setLong(i++, duration); sql.setInt(i++, bytes);
Any insights as to the cause of this exception would be appreciated.
Thanks.
-brian Received on Sun Dec 17 2000 - 21:36:48 CET