Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: plsql and dba_constraints
Hi -
I am not too sure but in addition to direct privilege on those tables you may need to do it via dbms_sql package.
Suresh
Kent Eilers <kent.eilers_at_pca.state.mn.us> wrote in article
<378270D7.47BBFCF6_at_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 Wed Jul 07 1999 - 11:18:59 CDT