Search notes:

Oracle SQL noun: CONSTRAINTS

Example: SET CONSTRAINTS … DEFERRABLE

create table tq84_p (
   id  integer,
   val varchar2(10),
 constraint
   tq84_p_pk primary key(id)
);

create table tq84_c (
   id_p,
   num    number,
constraint
   tq84_c_fk foreign key (id_p) references tq84_p deferrable
);

set constraints tq84_c_fk deferred;

insert into tq84_c values (1, 11);

--
-- Cannot commit here. A commit would cause
--   ORA-02091: transaction rolled back
--   ORA-02291: integrity constraint (RENE.TQ84_C_FK) violated - parent key not found


insert into tq84_p values (1, 'one');

commit;

drop table tq84_c;
drop table tq84_p;

See also

Constraints
Transactions
The alter session set constraints statement.
ORA-02447: cannot defer a constraint that is not deferrable

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758206322, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/SQL/statement/nouns/constraints/index(76): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78