Questions tagged [ora-01400]

ORA-01400: cannot insert NULL into ("SCHEMA"."TABLE_NAME"."COLUMN_NAME") Cause: You tried to insert a NULL value into a column that does not accept NULL values.

ORA-01400: cannot insert NULL into ("SCHEMA"."TABLE_NAME"."COLUMN_NAME")

Cause:

You tried to insert a NULL value into a column that does not accept NULL values.

Solution:

Correct your INSERT statement so that you do not insert a NULL value into a column that is defined as NOT NULL.

28 questions
11
votes
4 answers

Handle ORACLE Exceptions

I need to handle the ORA-01400 error (cannot insert NULL into ("SCHEMA"."TABLE_NAME"."COLUMN_NAME") ) using a exception handle. ORACLE Predefine a few Exceptions like (ACCESS_INTO_NULL, ZERO_DIVIDE and so on), but apparently does not define an…
RRUZ
  • 134,889
  • 20
  • 356
  • 483
5
votes
5 answers

ORA-01400 can't insert null value... but I am NOT inserting null value!

I am trying to insert data in an Oracle table by using ODP.NET from a C# application, but I am getting an ORA-01400 can't insert null value error for a column in which I am NOT inserting a null value. This is the stripped down version of the…
Konamiman
  • 49,681
  • 17
  • 108
  • 138
5
votes
4 answers

EJB3 - @Column(insertable="false") question

I'm building a J2SE application with EJB3 and an Oracle Express Edition DB. My problem is like that - I set an EntityBean in my project which matches a table in the DB. The table contains a column which is not nullable and has a default value. All I…
WhiteTigerK
  • 51
  • 1
  • 2
5
votes
3 answers

Rails modeling: converting HABTM to has_many :through

I'm doing maintenance work on an existing Rails site and am having some problems stemming from many-to-many associations. It looks like the site was initially built using has_and_belongs_to_many for a few relationships that have since gotten more…
justinbach
  • 1,945
  • 26
  • 44
5
votes
3 answers

ORA-01400 when trying to insert into schema.table.ID

I have a table that stores rejected contract proposals. CREATE TABLE "STATUS_CONTRATO" ( "STC_ID" NUMBER NOT NULL, "CTB_CONTRATO" NUMBER NOT NULL, "STC_DATA" DATE NOT NULL, "STC_OBSERVACAO" VARCHAR2(200) NOT NULL, CONSTRAINT…
Timoteo Brasil
  • 98
  • 3
  • 12
4
votes
2 answers

ORA-01400 cannot insert null error in one to one relationship

i have this code public void guardarAspirante(AspiranteDTO aspiranteDTO) { Aspirante aspirante = new Aspirante(); String usuarioMovimiento = AspiranteCN.class.getSimpleName(); Date fecha = new Date(); …
JoseJC
  • 758
  • 1
  • 9
  • 20
4
votes
3 answers

ORACLE - Cannot insert a NULL value to a NON-Primary Key

I Have searched the web and various forums but I cannot figure out why this won't work. My Database is made up from the following Tables: CREATE TABLE CUSTOMER( custid Number(4), cfirstname varchar2(30), csurname varchar2(20) NOT NULL, billingaddr…
Danny Mahoney
  • 1,255
  • 2
  • 13
  • 24
4
votes
1 answer

Oracle Insert returning ORA-01400

I am attempting the following SQL in an Oracle 11g DB, which returns SQL Error: ORA-01400: cannot insert NULL into ("CRABERS"."AG_ASSET_REF"."CREATE_ID"). However, you can see that I am populating this column, which is formatted as…
3
votes
1 answer

Hibernate and ORA-01400: cannot insert NULL

I've got fairly simple scenario, one table, one sequence for auto-generating primary keys : CREATE TABLE foo (event_id NUMBER(19,0).... CREATE SEQUENCE event_seq Part of the hibernate mapping looks like this: ...
Dima
  • 4,068
  • 4
  • 38
  • 47
3
votes
0 answers

Strange Behaviour Related to ORA-01400 Error

I'm creating a table on our database with version Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64b create table tahakkuk_kalem( id int generated always as identity primary key, …
Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
3
votes
1 answer

Hibernate + Oracle, strange null constraint violation with primitive type

I just add a new column on an entity and a strange thing is happening. The entity was previously: int publishedDayNb; public int getPublishedDayNb() { return publishedDayNb; } public void setPublishedDayNb(int publishedDayNb) { …
Sebastien Lorber
  • 89,644
  • 67
  • 288
  • 419
3
votes
3 answers

ASP.Net C# CreateParameter with empty string

In my ASP.net C# web project I have a query command object that has parameters. I use the following code to fill the parameters: DbCommand command = conn.CreateCommand(); command.CommandText = query; DbParameter param =…
Jens
  • 1,499
  • 3
  • 17
  • 28
3
votes
1 answer

How do I map Hibernate collections with Oracle's NOT NULL column constraint enforced?

I have 2 tables, ENQUIRY and ELEMENT with a One-to-Many relationship such that an Enquiry has many Elements. I would like to enforce Oracle's NOT NULL constraint on foreign key column ELEMENT.ENQUIRY_ID as this is best-practice. I have the…
Andrew Eells
  • 735
  • 12
  • 30
3
votes
1 answer

In Django, why is migration to Oracle resulting in attempts to save instances with null ID?

I'm migrating a Django project from SQLite to Oracle, and I'm getting an error thrown on the line disn_requisition.save() claiming that it has a null ID. I have not attempted to manually set or fiddle with id fields on any model, although I do read…
Christos Hayward
  • 5,777
  • 17
  • 58
  • 113
3
votes
1 answer

Oracle DML errors lacking detail

I am catching errors from a bulk insert operation like this: begin --bulk insert forall i in v_data.first .. v_data.last save exceptions insert into my_filter_table values v_data (i); commit; exception -- catch and print…
FrustratedWithFormsDesigner
  • 26,726
  • 31
  • 139
  • 202
1
2