PL/SQL (MOSC)

MOSC Banner

SET CONSTRAINTS in procedure results in ORA-922

edited Jul 7, 2011 3:35AM in PL/SQL (MOSC) 2 commentsAnswered ✓
 Hi all.  Am running Oracle Enterprise Edition, 11.2.0.2.  Am trying to defer constraint validation inside a procedure, but the command to do so isn't recognized.  Is there something I'm missing?

Here's a quick-n-dirty sample:

create or replace package bob_test is
    procedure cons_test;
end bob_test;
/

create or replace package body bob_test is
    procedure cons_test is
        cnt number;
    begin
        set constraints all deferred;
        select count(*) into cnt from dual;
    end cons_test;
end bob_test;
/

show errors

When I attempt to run this I get the following:

Errors for PACKAGE BODY BOB_TEST:

LINE/COL ERROR
-------- -----------------------------------------------------------------

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center