Re: ORA-01438: value larger than specified precision allows for this column

From: David Fitzjarrell <oratune_at_msn.com>
Date: 28 Oct 2002 09:33:06 -0800
Message-ID: <32d39fb1.0210280933.2e669ffe_at_posting.google.com>


Precision refers to the number of decmial places a field can accept, or contain. Apparently your sums generate a number of decimal places in excess of the number declared for the given column. You may need to round the sum to the given number of places to enable the insert.

"Jasna Prester" <jasna.prester_at_viadukt.tel.hr> wrote in message news:<apj28q$4em8$1_at_as201.hinet.hr>...
> Hi everyone,
>
> Probable this looks as a trivial problem to all of you but it seems huge to
> me. The point is that I have one table from which I want to insert sums into
> other. Now, the second table is the exact replica of the first, except that
> I enlarged all the fields so that all the sums can fit in - but - I still
> get the same error.
>
> I checked the overall sum and it doesnt exceed the precision of eny field.
>
> The SQL I'm doing it with is:
>
> DECLARE
> V_GOD VARCHAR2(4);
>
> BEGIN
>
> V_GOD:='2002';
>
>
> DELETE FROM OS_TROS_GOD WHERE GODINA=V_GOD;
> COMMIT;
>
>
>
> INSERT INTO OS_TROS_GOD ( OS, MJESEC, GOD, "SATI VOZNJE", "SATI ZASTOJA",
> "VRIJEDNOST RADA", "SATI ODRZAVANJA", "IZNOS ODRZAVANJA", "IZNOS
> MATERIJALA",
> "KOL GUMA", "VRIJED GUMA", "KOL NAFTE", "IZNOS NAFTE", "KOL
> MAZIVA",
> "IZNOS MAZIVA", "KOL ULJA", "IZNOS ULJA", AKUMULATORA, "IZNOS
> AKUMULATORA",
> "UKUP KM", "TROSK 3 LICA I OSTALI TROSK", AMORTIZACIJA, TONA,
> KUBIK,
> "KOL BENZINA", "IZNOS BENZ", INVEST, GODINA, PRAZNO, DATUM )
> SELECT OS_TROSKOVI.OS, Max(OS_TROSKOVI.MJESEC) AS MaxOfMJESEC,
> Max(OS_TROSKOVI.GOD) AS MaxOfGOD,
> Sum(OS_TROSKOVI."SATI VOZNJE") AS SV, Sum(OS_TROSKOVI."SATI
> ZASTOJA") AS SZ,
> Sum(OS_TROSKOVI."VRIJEDNOST RADA") AS SR,
> Sum(OS_TROSKOVI."SATI ODRZAVANJA") AS SO,
> Sum(OS_TROSKOVI."IZNOS ODRZAVANJA") AS IO,
> Sum(OS_TROSKOVI."IZNOS MATERIJALA") AS IM,
> Sum(OS_TROSKOVI."KOL GUMA") AS KG,
> Sum(OS_TROSKOVI."VRIJED GUMA") AS VG,
> Sum(OS_TROSKOVI."KOL NAFTE") AS KN,
> Sum(OS_TROSKOVI."IZNOS NAFTE") AS INAF,
> Sum(OS_TROSKOVI."KOL MAZIVA") AS KM,
> Sum(OS_TROSKOVI."IZNOS MAZIVA") AS IMA,
> Sum(OS_TROSKOVI."KOL ULJA") AS KU,
> Sum(OS_TROSKOVI."IZNOS ULJA") AS IU,
> Sum(OS_TROSKOVI.AKUMULATORA) AS SA,
> Sum(OS_TROSKOVI."IZNOS AKUMULATORA") AS IAK,
> Sum(OS_TROSKOVI."UKUP KM") AS UKKM,
> Sum(OS_TROSKOVI."TROSK 3 LICA I OSTALI TROSK") AS SOT,
> Sum(OS_TROSKOVI.AMORTIZACIJA) AS SumOfAMORTIZACIJA,
> Sum(OS_TROSKOVI.TONA) AS SumOfTONA,
> Sum(OS_TROSKOVI.KUBIK) AS SumOfKUBIK,
> Sum(OS_TROSKOVI."KOL BENZINA") AS KB,
> Sum(OS_TROSKOVI."IZNOS BENZ") AS IB,
> Sum(OS_TROSKOVI.INVEST) AS SumOfINVEST,
> Max(OS_TROSKOVI.GODINA) AS MaxOfGODINA,
> Count(OS_TROSKOVI.PRAZNO) AS CountOfPRAZNO,
> Max(OS_TROSKOVI.DATUM) AS MaxOfDATUM
> FROM OS_TROSKOVI
> GROUP BY OS_TROSKOVI.OS;
>
>
>
> END;
> /
>
>
>
> and the error I get is:
>
> Input truncated to 1 characters
> DECLARE
> *
> ERROR at line 1:
> ORA-01438: value larger than specified precision allows for this column
> ORA-06512: at line 14
>
>
> The Oracle database is version 8.1.7, enterprise edition.
>
>
> If anyone can help with any sugestion, I would be very grateful.
>
>
>
> Jasna Prester
Received on Mon Oct 28 2002 - 18:33:06 CET

Original text of this message