Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Deferred constraint question
Strange - the following demo suggests it works (event with dbms_sql.v7 rather than the 'native' that another user proposed).
The output from the SQL is interspersed, with a couple of extra comments.
drop table jpl_demo;
create table jpl_demo(
n1 number, constraint jpl_ck_n1 check (n1 = 25) deferrable initially immediate);
insert into jpl_demo values(10);
*** *
declare
v_junk pls_integer; n pls_integer; begin n := dbms_sql.open_cursor; dbms_sql.parse (n, 'set constraint jpl_ck_n1 deferred', dbms_sql.v7); v_junk := dbms_sql.execute(n); dbms_sql.close_cursor(n);
insert into jpl_demo values(10);
select * from jpl_demo;
set constraint jpl_ck_n1 immediate;
*** *
rem
rem AND SURELY THIS IS AN ERROR, or has the constraint
rem not become immediate because that state is inconsistent
rem with the bad data already in place ?
rem
insert into jpl_demo values(11);
select * from jpl_demo;
commit;
*** *
--
Jonathan Lewis
Yet another Oracle-related web site: www.jlcomp.demon.co.uk
Jim Jenkinson wrote in message ...
>That was my thought as well, but, although the statement parses and
executes
>without error, the constraint remains in immediate mode.
Received on Fri Jun 25 1999 - 08:59:55 CDT