• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2182
  • Last Modified:

forms / trigger question

Hello all you Oracle forms / trigger gurus,

What's the default pl/sql action of a key-entqry (enter query)?
What's the default pl/sql action of a key-exeqry (execute query)?

I need to modify the trigger action of a key-exeqry at block
level. I assume that during a key-entqry the data is collected
from the keyboard that allows a select statement to be constructed
and executed when key-exeqry trigger is fired. How do I intervene
to add an extra select statement?

Martin Meadows
1 Solution
Hi Martin,

The default pl/sql action of 'KEY-ENTQRY' is ENTER_QUERY
The default pl/sql action of 'KEY-EXEQRY' is EXECUTE_QUERY

I would suggest that you modify the PRE-QUERY trigger instead of the KEY-EXEQRY. To find out more about how modify the PRE-QUERY trigger, search Forms Online Help for 'Pre-Query'. Make sure to read the topic 'Controlling Queries with Pre-Query and Post-Query Triggers'.

mmeadowsAuthor Commented:
I don't seem to have the doc you mentioned. Is this doc unique
to post sqlforms30? Since you suggested I use the pre-query trigger I tried to do something like this:

select * from bill_material_hours
  where bmh_so_# = :block1.bmm_so_#
  and bmh_so_item_# = :block1.bmm_so_item_#
  and bmh_so_chg_# = :block1.bmm_so_chg_#;

I'm trying to work this select statement into block5.
The selected rows therefore depend on data that
was entered in block1. Unfortunately, I can't
compile the select statement! It's expecting
the keywork INTO after the *. This is a V3 trigger.
so why won't it work without INTO?

Martin Meadows

Are we to assume you are working with Forms v3?
If not which version of forms are we looking at?
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

mmeadowsAuthor Commented:
Yes, sql*forms v3. Sorry I didn't make that clear from the start.


It would help to know what behavior you're trying to achieve.  Are you trying to populate block5 based on a query in block1?

If so, you want your query in a post-query trigger on block1, and yes you need the INTO clause if you want to populate fields in the form from the query.  (Even if you DON'T need it, explicit code is generally more readable - I'm PAINFULLY familiar with trying to read the messy, undocumented code of others.)

Incidentally, the difference between a key- trigger and the corresponding trigger 'function' is that the key trigger will only fire as a response to the 'key sequence' (i.e. if the operator strikes the query key, however that's mapped), and the 'function' is what is called, by default.  The pre- or post- type triggers (e.g. pre-query) are executed whenever that function is performed (even in response to a programmatic event).

Note also that, if you use the key- trigger, your code will REPLACE the standard behavior (i.e. the call to the function); for that reason, you generally will want to finish a key- trigger with the function call explicitly, e.g.

  your code here
mmeadowsAuthor Commented:
Sorry I took so long to respond. Have moved on to other things.
Frankr & Jih: thanks for the assistance & the clarification. I
guess I need to give someone credit for answering my question
now but I don't have an option to accept the answers on my screen. All I can do is enter this comment & submit it.

By the way, yes, Frankr, I was trying to populate block5 with
stuff from block1.
The reason you don't have an 'accept answer' choice is that none of us have submitted any of our feedback as an 'Answer', aside from the first from Jesper that you rejected.  If you think any of the comments are most appropriate for acceptance as an answer, why don't you tell whichever one of us you choose to submit something as an answer, which will give you a chance to accept it.

If you really solved your question yourself, or if nobody in particular can be credited with the answer (there's no way to split awards), you could ask the moderator to just close the question for you without any award.
mmeadowsAuthor Commented:
Frankr, I think you should get credit for providing the most
help on this so submit something as an answer & I'll grade it.
Thanks for the help. Marty

By the way, I have a couple of other open questions that I'd
like to have the moderator to close. How is that done? In a comment?
I was going to tell you to go to the Customer Service topic to request help with the other questions, but I just got back from there and I think you've figured that out for yourself.

Always glad to help.

BTW, if you're looking for other places to post questions, there's the IOUG-A website discussion groups.  They're open to non-members of IOUG-A (if you aren't a member).  ODTUG has a forum, too, I believe, but I think that one's members-only.

www.iouga.org and www.odtug.com
mmeadowsAuthor Commented:
thanks to of you for helping out & thanks for the pointer to iouga frankr.

M. Meadows
mmeadowsAuthor Commented:
Why does this question now say "10 points" at the top? I gave 100 points for it. Also, Frankr, the iouga web address you shared with me isn't working ...
Oops.  Sorry, should be www.ioug.org (somehow the Americas division of IOUG managed to hang onto the original domain when they divvied up the world into three big pieces).  I shouldn't ever trust my memory.

The points always drop to 10% of original for those who want to review answered questions.  Or you could look at it that the person who wanted the answer the most (the person that asked it) has to cough up 10x as many points.
mmeadowsAuthor Commented:
frankr, thanks for that last little tid-bit of info. it's much appreciated.

also note, I found the ioug.org address on my own when I did a web search for iouga. thanks for your reply though!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now