You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Brendan Miller <bm...@dotster.com> on 2008/10/08 18:13:26 UTC

ORA-01461 on update to VARCHAR2(3000)

We have an existing table we have newly wrapped with a Torque object
model by adding it to our schema.  It has three VARCHAR2(3000) fields
which we have modeled as 

 <column name="CERT_STRING" size="3000" type="VARCHAR"/>

When performing an update to an object fetched from this table, we 
receive:

ORA-01461: can bind a LONG value only for insert into a LONG column

It looks like this comes from Village somewhere (I can provide the stack
trace, if you'd like).  This is Oracle 9i.

I tried using LONGVARCHAR, but it maps to the same .setString in
Village's Value class.  I really couldn't tell where Torque/Village
could be messing up, so maybe this is an Oracle thing.

Has anyone ran into this kind of problem before?

Brendan

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: ORA-01461 on update to VARCHAR2(3000)

Posted by Alvaro Coronel <al...@yahoo.com>.
Does it matter? Dunno * 4!


I once saw a call like this somewhere

          Locale.setDefault(Locale.ENGLISH);

but I would bet it's politically incorrect.

Best regards,
Álvaro.


--- On Wed, 10/8/08, Brendan Miller <bm...@dotster.com> wrote:
From: Brendan Miller <bm...@dotster.com>
Subject: Re: ORA-01461 on update to VARCHAR2(3000)
To: "Apache Torque Users List" <to...@db.apache.org>, alvarocoronel67@yahoo.com
Date: Wednesday, October 8, 2008, 3:05 PM

Good point.  I ran the query for curiosity, and we are using UTF8.  So
this *could* happen.  But in the case of this data, the string is 1200
or so bytes of regular ASCII-7 (printable) data.

So I fear something else is at work. 

Also, how does one "configure his client" (Torque) accordingly to be
UTF8 aware?  Or does it matter?  Or does it matter?  Or does it matter?
Or does it matter?

Brendan

On Wed, Oct 08, 2008 at 09:43:10AM -0700, Alvaro Coronel wrote:
> The problem can be the character set. You may be sending 3000 characters
and the DB will store 9000 bytes.
> 
> Check Oracle's character set:
> 
> SELECT VALUE FROM v$nls_parameters WHERE PARAMETER =
'NLS_CHARACTERSET';
> 
> then configure your client accordingly.
> 
> Sincerely,
> Álvaro
> 
> P.S. No I don't know this. Just googled ORA-01461 and found this post
(spanish)
> 
>
http://oraclenotepad.blogspot.com/2007/05/ora-01461-can-bind-long-value-only-for.html
> 
> but I _have_ seen trouble w/Oracle.
> 
> --- On Wed, 10/8/08, Brendan Miller <bm...@dotster.com> wrote:
> From: Brendan Miller <bm...@dotster.com>
> Subject: ORA-01461 on update to VARCHAR2(3000)
> To: torque-user@db.apache.org
> Date: Wednesday, October 8, 2008, 1:13 PM
> 
> We have an existing table we have newly wrapped with a Torque object
> model by adding it to our schema.  It has three VARCHAR2(3000) fields
> which we have modeled as 
> 
>  <column name="CERT_STRING" size="3000"
> type="VARCHAR"/>
> 
> When performing an update to an object fetched from this table, we 
> receive:
> 
> ORA-01461: can bind a LONG value only for insert into a LONG column
> 
> It looks like this comes from Village somewhere (I can provide the stack
> trace, if you'd like).  This is Oracle 9i.
> 
> I tried using LONGVARCHAR, but it maps to the same .setString in
> Village's Value class.  I really couldn't tell where
Torque/Village
> could be messing up, so maybe this is an Oracle thing.
> 
> Has anyone ran into this kind of problem before?
> 
> Brendan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org




      

Re: ORA-01461 on update to VARCHAR2(3000)

Posted by Brendan Miller <bm...@dotster.com>.
Good point.  I ran the query for curiosity, and we are using UTF8.  So
this *could* happen.  But in the case of this data, the string is 1200
or so bytes of regular ASCII-7 (printable) data.

So I fear something else is at work. 

Also, how does one "configure his client" (Torque) accordingly to be
UTF8 aware?  Or does it matter?  Or does it matter?  Or does it matter?
Or does it matter?

Brendan

On Wed, Oct 08, 2008 at 09:43:10AM -0700, Alvaro Coronel wrote:
> The problem can be the character set. You may be sending 3000 characters and the DB will store 9000 bytes.
> 
> Check Oracle's character set:
> 
> SELECT VALUE FROM v$nls_parameters WHERE PARAMETER = 'NLS_CHARACTERSET';
> 
> then configure your client accordingly.
> 
> Sincerely,
> Álvaro
> 
> P.S. No I don't know this. Just googled ORA-01461 and found this post (spanish)
> 
> http://oraclenotepad.blogspot.com/2007/05/ora-01461-can-bind-long-value-only-for.html
> 
> but I _have_ seen trouble w/Oracle.
> 
> --- On Wed, 10/8/08, Brendan Miller <bm...@dotster.com> wrote:
> From: Brendan Miller <bm...@dotster.com>
> Subject: ORA-01461 on update to VARCHAR2(3000)
> To: torque-user@db.apache.org
> Date: Wednesday, October 8, 2008, 1:13 PM
> 
> We have an existing table we have newly wrapped with a Torque object
> model by adding it to our schema.  It has three VARCHAR2(3000) fields
> which we have modeled as 
> 
>  <column name="CERT_STRING" size="3000"
> type="VARCHAR"/>
> 
> When performing an update to an object fetched from this table, we 
> receive:
> 
> ORA-01461: can bind a LONG value only for insert into a LONG column
> 
> It looks like this comes from Village somewhere (I can provide the stack
> trace, if you'd like).  This is Oracle 9i.
> 
> I tried using LONGVARCHAR, but it maps to the same .setString in
> Village's Value class.  I really couldn't tell where Torque/Village
> could be messing up, so maybe this is an Oracle thing.
> 
> Has anyone ran into this kind of problem before?
> 
> Brendan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: ORA-01461 on update to VARCHAR2(3000)

Posted by Alvaro Coronel <al...@yahoo.com>.
The problem can be the character set. You may be sending 3000 characters and the DB will store 9000 bytes.

Check Oracle's character set:

SELECT VALUE FROM v$nls_parameters WHERE PARAMETER = 'NLS_CHARACTERSET';

then configure your client accordingly.

Sincerely,
Álvaro

P.S. No I don't know this. Just googled ORA-01461 and found this post (spanish)

http://oraclenotepad.blogspot.com/2007/05/ora-01461-can-bind-long-value-only-for.html

but I _have_ seen trouble w/Oracle.

--- On Wed, 10/8/08, Brendan Miller <bm...@dotster.com> wrote:
From: Brendan Miller <bm...@dotster.com>
Subject: ORA-01461 on update to VARCHAR2(3000)
To: torque-user@db.apache.org
Date: Wednesday, October 8, 2008, 1:13 PM

We have an existing table we have newly wrapped with a Torque object
model by adding it to our schema.  It has three VARCHAR2(3000) fields
which we have modeled as 

 <column name="CERT_STRING" size="3000"
type="VARCHAR"/>

When performing an update to an object fetched from this table, we 
receive:

ORA-01461: can bind a LONG value only for insert into a LONG column

It looks like this comes from Village somewhere (I can provide the stack
trace, if you'd like).  This is Oracle 9i.

I tried using LONGVARCHAR, but it maps to the same .setString in
Village's Value class.  I really couldn't tell where Torque/Village
could be messing up, so maybe this is an Oracle thing.

Has anyone ran into this kind of problem before?

Brendan

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org