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 -> Re: puzzled by ora-01438

Re: puzzled by ora-01438

From: Ed Stevens <nospam_at_noway.nohow>
Date: Fri, 05 Mar 2004 15:57:56 -0600
Message-ID: <gtth40put7sr9hu6j7hjp1neshiblhvf0v@4ax.com>


On Fri, 5 Mar 2004 19:54:10 +0100, "Michel Cadot" <micadot{at}altern{dot}org> wrote:

>
>"Ed Stevens" <nospam_at_noway.nohow> a écrit dans le message de
>news:kmfh40tj2o2i2redknef1focghtf1ebif8_at_4ax.com...
>> Oracle 8.1.7.4 on Win2k
>>
>> In trying to introduce a little more real-world-ness to some testnig
>> I'm doing (see thread "need ideas for proof test") and am having a bit
>> of trouble with generating a random number to use as a column value.
>>
>> Here's the first part of the table def:
>>
>> CREATE TABLE .EDS_TEST_KEY_FIRST
>> (
>> SUPL_KEY NUMBER(3) NOT NULL,
>> CLM_KEY CHAR(8) NOT NULL,
>> LIAB_AMT NUMBER(9,2) NOT NULL,
>> <snip>
>>
>> And here's the code I'm using to load it:
>>
>> truncate table .EDS_TEST_KEY_FIRST;
>>
>> BEGIN
>> DBMS_RANDOM.INITIALIZE (12345);
>>
>> FOR i IN 1..5000
>> LOOP
>>
>> INSERT INTO PUR003.EDS_TEST_KEY_FIRST
>> VALUES
>> (i,
>> substr(to_char(dbms_random.random),1,8),
>> 1234567.12,
>> <snip>
>>
>> If I set the loop for 500, everything works as planned. But when I
>> bump it to 5000, I get this:
>>
>> BEGIN
>> *
>> ERROR at line 1:
>> ORA-01438: value larger than specified precision allows for this
>> column
>> ORA-06512: at line 7
>>
>
>5000 can't be inserted in a number(3).
>See first value of your insert.
>
>Regards
>Michel Cadot
>

Thanks, Michel. That was it. I was simply too close to the problem to see it. Received on Fri Mar 05 2004 - 15:57:56 CST

Original text of this message

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