RE: ORA-01722: invalid number

From: Powell, Mark <mark.powell2_at_hp.com>
Date: Fri, 30 Jan 2015 21:26:21 +0000
Message-ID: <1E24812FBE5611419EFAFC488D7CCDD126F5FF1E_at_G6W2491.americas.hpqcorp.net>


What full version of Oracle? Is the database using byte or character semantics? What is the session default date format?

Using 10.2.0.5 I was unable to duplicate your problem but we use character semantics and the default date format. MPOWEL01> create table fattura_master (

  2  sezionale    nvarchar2(3) ,
  3  anno         number       ,
  4  numero       number       ,
  5  data_emissione     date

  6 );

Table created.

MPOWEL011>
MPOWEL011> INSERT INTO fattura_master (sezionale, anno, numero, data_emissione) VALUES ('04', 2015, 9999, current_date)   2 ;

1 row created.

-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Jose Soares Sent: Friday, January 30, 2015 6:19 AM
To: oracle-l_at_freelists.org
Subject: ORA-01722: invalid number

Hi all,
I have a strange error that I can't understand when I try to insert a row into the table below, I get this error:

(DatabaseError) ORA-01722: invalid number   "INSERT INTO fattura_master (sezionale, anno, numero, data_emissione) VALUES ('04', 2015, 9999, current_date)"

here's the table schema:

name                      | type                       | length| 
nullable| default
--------------------------+ ---------------------------+ ------+ 
--------+ ------------------
tipo_documento            | nvarchar2                  | 1     | Y       

| NULL
sezionale | nvarchar2 | 3 | N
| NULL
anno | number | 0 | N
| NULL
numero | number | 0 | N
| NULL
data_emissione | date | 0 | N
| NULL
data_competenza | date | 0 | Y
| NULL
tipo_pagamento | nvarchar2 | 5 | Y
| NULL
data_pagamento | date | 0 | Y
| NULL
importo_pagato | number | 0 | Y
| '0.0'
bollo | number | 0 | Y
| '0.0'
note | nvarchar2 | 200 | Y
| NULL
ced | number | 0 | Y
| NULL
id_anagrafica_sede_fiscale| number | 0 | Y
| NULL
intestazione | nvarchar2 | 100 | Y
| NULL
indirizzo | nvarchar2 | 100 | Y
| NULL
cap | nvarchar2 | 5 | Y
| NULL
comune | nvarchar2 | 100 | Y
| NULL
provincia | nvarchar2 | 2 | Y
| NULL
codice_fiscale | nvarchar2 | 16 | Y
| NULL
partita_iva | nvarchar2 | 11 | Y
| NULL
id_distretto | number | 0 | Y
| NULL
istat | nvarchar2 | 6 | Y
| NULL
iva | number | 0 | Y
| '0.0'
aliquota_iva | number | 0 | Y
| NULL
imponibile | number | 0 | Y
| '0.0'
enpav_iva | number | 0 | Y
| '0.0'
fuori_campo | number | 0 | Y
| '0.0'
enpav_fc | number | 0 | Y
| '0.0'
rif_nr_na | number | 0 | Y
| NULL
rif_aa_na | number | 0 | Y
| NULL
codice_cliente | nvarchar2 | 15 | Y
| NULL
codice_attivita | nvarchar2 | 10 | Y
| NULL
ts_ultima_modifica | timestamp(6) with time zone| 0 | Y
| CURRENT_TIMESTAMP
id_operatore | number | 0 | Y

| NULL

(34 rows)

index_type | index_name | uniqueness| column_name| column_position -----------+ -------------+ ----------+ -----------+ ---------------

primary key| sys_c00116651| unique    | sezionale  | 1
primary key| sys_c00116651| unique    | anno       | 2
primary key| sys_c00116651| unique    | numero     | 3
--------------------------------------------------------------------------------------------------------------------
thanks for any help.

j

--
http://www.freelists.org/webpage/oracle-l


--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jan 30 2015 - 22:26:21 CET

Original text of this message