user1467741
user1467741

Reputation: 41

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 number(38,0). As I am inserting a value, why else might I be receiving ORA-01400?

INSERT INTO ag_asset_ref
            (asset_type_id,
             create_id,
             create_date,
             file_size,
             bus_unit_id,
             status,
             name)
VALUES      ( 1050,
             2458,
             SYSDATE,
             50000,
             1000,
             0,
             'test insert' ) 

Upvotes: 4

Views: 1728

Answers (1)

Jeff
Jeff

Reputation: 736

With this trigger your error appears:

CREATE TRIGGER t_ag_asset_ref BEFORE INSERT OR UPDATE ON ag_asset_ref
FOR EACH ROW
BEGIN
    :NEW.create_id := NULL;
END;

You case is probably not so simple but a trigger can certainly be the cause.

Upvotes: 2

Related Questions