PROCEDURE EM TRIGGER PRE-INSERT

Dicas do Oracle Forms Builder - Blocos, Itens, LOV, Canvas, Triggers, comandos, PLL, d2kwutil, FMB, Alert, menus, etc
Responder
suelana
Rank: Programador Sênior
Rank: Programador Sênior
Mensagens: 63
Registrado em: Qui, 10 Ago 2006 6:07 pm
Localização: Joinville-SC
Suelana BLU-JLLE

Por que não posso executar NEXT_RECORD, FIRST_RECORD, GO_RECORD, GO_BLOCK em uma procedure que é chamada a partir de trigger PRE-INSERT ?

Quando e onde poderei então usar estes build-in ?
Avatar do usuário
dr_gori
Moderador
Moderador
Mensagens: 5024
Registrado em: Seg, 03 Mai 2004 3:08 pm
Localização: Portland, OR USA
Contato:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

Essas built-in GO_ITEM, GO_BLOCK, etc são restritas!

Veja o que o HELP tem a dizer sobre elas (em ingles, infelizmente)
About restricted built-in subprograms

Any built-in subprogram that initiates navigation is restricted. This includes subprograms that move the input focus from one item to another, and those that involve database transactions. Restricted built-ins are not allowed in triggers that fire in response to navigation.
For example, the GO_ITEM and NEXT_SET built-ins are both restricted procedures. GO_ITEM moves the input focus from a source item to a target item, which requires navigation. Similarly, the NEXT_SET procedure causes Form Builder to navigate internally to the block level, fetch a set of records, and then navigate to the first item in the first record. (Note that this navigation happens internally as a result of default processing, and may not be apparent to the form operator.)

Because GO_ITEM and NEXT_SET both initiate navigation, they cannot be called from triggers that fire in response to internal navigational events; that is, triggers that fire while navigation is already occurring. Thus, a restricted procedure cannot be called from a Pre-Block trigger, because the Pre-Block trigger fires during internal navigation. In fact, restricted subprograms are not allowed from any PRE- or POST- navigational triggers.

You can, however, call a restricted built-in subprogram from a When-New-Instance trigger. For example, the When-New-Item-Instance trigger fires after navigation to an item has succeeded, when the form is waiting for input. This is an important point to remember as you select trigger types during application development.
The reference topic of each trigger has a "Legal Commands" section that describes which types of built-ins (restricted or unrestricted) can be called from the trigger. Also, each built-in description includes a "Built-in Type" section that indicates whether the built-in is a restricted or unrestricted procedure or function.
Pode usá-las em botões, ou nas triggers when-new-Instance.
Responder
  • Informação
  • Quem está online

    Usuários navegando neste fórum: Nenhum usuário registrado e 11 visitantes