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
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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?
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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. and

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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 (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 address on my own when I did a web search for iouga. thanks for your reply though!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.