Home > database >  Oracle according to the actual value is too large, but that is not beyond the limit, I consult
Oracle according to the actual value is too large, but that is not beyond the limit, I consult

Time:10-09

If inscribe
The create table users
Primary key (user_id char (8),
User_name varchar2 (20) unique,
Password varchar2 (20) not null,
Phone varchar2 (11) not null,
Money number check (money> 0));

The create table goods
(g_id char (1) primary key,
G_name varchar2 (20) not null,
G_show varchar2 (80),
G_price number check (g_price & gt; 0),
User_id char (8),
Foreign key (user_id) references the users (user_id) deferrable);
This is I create two tables, but when I insert the data after the show I insert value too big how be to return a responsibility, but in fact I insert the value of the same as for users_id is on the table, what is this refer to

CodePudding user response:

Have been solved, but a new problem,
The create table goods
(g_id char (1) primary key,
G_name varchar2 (20) not null,
G_show varchar2 (80),
G_price number check (g_price & gt; 0),
User_id char (8),
Foreign key (user_id) references the users (user_id) deferrable);

The create table orders
(o_id char (1) primary key,
O_money number check (o_money & gt; 0),
User_id char (8),
Foreign key (user_id) references the users (user_id) deferrable);

The create table orders_item
Primary key (os_id char (11),
O_id char (10),
G_id char (10),
Foreign key (o_id) references the orders (o_id),
Foreign key references (g_id) goods (g_id) deferrable);

This is my three tables, the former two tables of data has been successfully inserted in, but I'm in the third table to insert data, according to
ORA - 02291: violate integrity constraints (SYSTEM. SYS_C007459) - not found the parent keyword
I can confirm that I am not insert data appeared error, excuse me, how to solve, this is the foreign key ring?

CodePudding user response:

Already all solved

CodePudding user response:

Error actually already very clear, according to the prompt treatment can,
  • Related