Subject grants
Author Alexandre Benson Smith
Hi people !

Sometimes I forget to type the correct command and stay wondering why I
have no access to insert records in tables.

take a look here
I have a procedure Get_NaturezaOperacao_LoteTipo that should be used by
another SP and by 3 triggers see below:
grant execute on procedure Get_NaturezaOperacao_LoteTipo to
Get_PedidoVendaItem_Dados;
grant execute on procedure Get_NaturezaOperacao_LoteTipo to
TI_PEDIDOVENDAITEM_RESERVADA;
grant execute on procedure Get_NaturezaOperacao_LoteTipo to
TU_PEDIDOVENDAITEM_RESERVADA;
grant execute on procedure Get_NaturezaOperacao_LoteTipo to
TD_PEDIDOVENDAITEM_RESERVADA;

but after I execute this grants I could not insert on table
PedidoVendaItem that has the 3 above triggers because I have no
permission to execute procedure Get_NaturezaOperacao_LoteTipo

The correct grants should be:
grant execute on procedure Get_NaturezaOperacao_LoteTipo to procedure
Get_PedidoVendaItem_Dados;
grant execute on procedure Get_NaturezaOperacao_LoteTipo to trigger
TI_PEDIDOVENDAITEM_RESERVADA;
grant execute on procedure Get_NaturezaOperacao_LoteTipo to trigger
TU_PEDIDOVENDAITEM_RESERVADA;
grant execute on procedure Get_NaturezaOperacao_LoteTipo to trigger
TD_PEDIDOVENDAITEM_RESERVADA;

note the lack of the words procedure and trigger in the former.

As I understand the former will grant to a user or role and take the
name of a procedure/trigger as the user/role name. What I wonder is why
FB let me grant something to a invalid user/role. If it complain about
it I will in a snap realize that I forget the procedure/trigger word.

Any comments ?

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br