Mamta Satoor wrote:
> Hi,
> 
> I spent some time prototyping revoke privilege for foreign key constraint
> based on my proposal earlier in this thread.
> I added following code to ConstraintDescriptor.makeInvalid
> 
>  if (action == DependencyManager.REVOKE_PRIVILEGE)
>  {
>   PreparedStatement ps = lcc.prepareInternalStatement("alter table "+
> table.getQualifiedName() + " drop constraint " + constraintName);
> 
>   ResultSet rs = ps.execute(lcc, true, 0L);
>   rs.close();
>   rs.finish();
>   return;
> 
>  }
> 
> This works fine as long as the user who issued the revoke references
> privilege is a dba or owner of the table on which foreign key constraint is
> defined. But for any other user, the revoke references privilege barfs
> saying that user can't perform the operation in that schema.

I would have exepected the ConstraintDescriptor to drop itself directly
using the DataDictionary apis, rather than go back through SQL. Would
that be possible?

Dan.


Reply via email to