Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> plsql and dba_constraints

plsql and dba_constraints

From: Kent Eilers <kent.eilers_at_pca.state.mn.us>
Date: Tue, 06 Jul 1999 16:10:47 -0500
Message-ID: <378270D7.47BBFCF6@pca.state.mn.us>


I can run the following fine from the command prompt:

        select 'alter table '||table_name||' ENABLE constraint
'||constraint_name as sql_str

        from dba_constraints
        where r_constraint_name
        IN (select constraint_name from dba_constraints where
lower(table_name) = as_table)
        and lower(table_name) <> as_table;

but get the error: "sys.dba_constraints must be declared" when I put this into a procedure as a cursor:

        CURSOR lc_enable IS
        select 'alter table '||table_name||' ENABLE constraint

'||constraint_name as sql_str
from dba_constraints where r_constraint_name IN (select constraint_name from dba_constraints where lower(table_name) = as_table) and lower(table_name) <> as_table;

Is it forbidden to access the dba tables within a procedure? Received on Tue Jul 06 1999 - 16:10:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US