foreign keys - Check constraints on two tables in Oracle -


i have 2 tables one-to-one relationship (and relationship mandatory 1 side only). follows:

create table prs (   id number(18) not null,   common_code varchar2(10),   constraint pk_prs primary key (id));  create table rlp {   id number(18),   spec_code varchar2(20),   constraint pk_rlp primary key (id),   constraint fk_rlp_prs foreign key (id) references prs(id) on delete cascade); 

so problem when inserting record in rlp @ least 1 of common_code or spec_code must have value.

is possible enforce constraint using constraint or solution having trigger?


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -