Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Fun With VARCHAR2

Fun With VARCHAR2

From: Martin Haltmayer <Martin.Haltmayer_at_0800-einwahl.de>
Date: 2000/04/08
Message-ID: <38EE6349.D42AB20D@0800-einwahl.de>#1/1

Oracle 8.1.5, NT 4.0 SP 6

I get two different error messages depending on the length of a varchar2. Both are too long, but they yield different error messages:

SQL>
SQL> create table test (n varchar2 (2000));

Table created.

 real: 351
SQL>
SQL> declare
  2 s varchar2 (4000):= lpad ('x', 4000, 'x');   3 begin
  4 insert into test (n) values (s);   5 end;
  6 /
declare
*

ERROR at line 1:
ORA-01401: inserted value too large for column ORA-06512: at line 4

 real: 310
SQL>
SQL> declare
  2 s varchar2 (4001):= lpad ('x', 4001, 'x');   3 begin
  4 insert into test (n) values (s);   5 end;
  6 /
declare
*

ERROR at line 1:
ORA-01461: can bind a LONG value only for insert into a LONG column ORA-06512: at line 4

 real: 0
SQL>
SQL> drop table test;

Table dropped.

Funny, isn't it? You would never expect an error message about a long column unless you use longs, right?

Martin Received on Sat Apr 08 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US