Run Query when you click the

Dicas do Oracle Forms Builder - Blocos, Itens, LOV, Canvas, Triggers, comandos, PLL, d2kwutil, FMB, Alert, menus, etc
Post Reply
douglasmattos
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 75
Joined: Mon, 19 Mar 2012 2:28 pm

Guys, I need your help.

and have a screen on forms, execute and we press F7 the system allows me to enter a value and click F8 to get this certain value.

I made a scheme similar to buttons. When I click the button it clears the screen and places the block ENTER QUERY mode;

Select all

GO_BLOCK('TI_PROCEDIMENTO_AIH'); 
GO_ITEM('TI_PROCEDIMENTO_AIH.CD_PROCEDIMENTO'); 
 
SET_ITEM_PROPERTY ('BOTOES.QUERY', VISIBLE, PROPERTY_FALSE); 
DO_KEY('CLEAR_FORM'); 
DO_KEY('ENTER_QUERY');
So far so good, the screen is clean and can enter the data that I want to look. After I enter the data I click another button to execute the query and bring the data to exist.

Select all

GO_BLOCK('TI_PROCEDIMENTO_AIH'); 
DO_KEY('EXECUTE_QUERY'); 
SET_ITEM_PROPERTY ('BOTOES.QUERY', VISIBLE, PROPERTY_TRUE); 
SET_ITEM_PROPERTY ('BOTOES.QUERY', ENABLED, PROPERTY_TRUE);
The theory'm trying to do the same to press F7 and F8 after.
The problem is that when I press the btn to execute the query and asks if I want to save the information and does nothing.

Some of the teachers there know help me?

I thank you for the tips: D: D
User avatar
tiago_pimenta
Rank: DBA Júnior
Rank: DBA Júnior
Posts: 213
Joined: Wed, 29 Jun 2011 9:49 am
Location: Barretos / SP

If he is asking to save, it is because at some point, you are sets values ??to the items of the block in question ... The first step is to review this.

The second step, you could remove the second

Select all

GO_BLOCK('TI_PROCEDIMENTO_AIH');
because when you click the button to clean the forms, you are already giving go_block, tended?


douglasmattos
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 75
Joined: Mon, 19 Mar 2012 2:28 pm

I understood ....

I will remove the go_block ...

Dude I put the value in the field because it is this value that I will look for.
Type Thus:

I want to press the button and the block stay in search mode, then type a value and then click on the other button to perform the data based on the data that I I typed.
User avatar
tiago_pimenta
Rank: DBA Júnior
Rank: DBA Júnior
Posts: 213
Joined: Wed, 29 Jun 2011 9:49 am
Location: Barretos / SP

I just made an example here, and the buttons have the following code and functioned

- Button 1 -

Select all

go_item('pessoa.pes_id'); 
 
do_key('clear_form'); 
do_key('enter_query');
- Button 2 -

Select all

do_key('execute_query');
douglasmattos
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 75
Joined: Mon, 19 Mar 2012 2:28 pm

When you click the button 2 it performs the query based on the data you typed right?

type typed 1 in the person field.pes_id and he sought that person in the bank.

I'll take a test here
douglasmattos
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 75
Joined: Mon, 19 Mar 2012 2:28 pm

Tiago did what you said and works in parts .... when I click to run it returns all the data that are registered the table ..... up there good.

But if I put some value I want to search for he asks to save.


The idea is to do equal to F7 and F8. Fleeps F7, I type the value I want to get and tightly F8. This works good, but I want to create buttons to do this same function.

Thanks for help ...
User avatar
tiago_pimenta
Rank: DBA Júnior
Rank: DBA Júnior
Posts: 213
Joined: Wed, 29 Jun 2011 9:49 am
Location: Barretos / SP

This, when I squeeze on Button 2, it looks for the code I typed. Just one thing I did, before pressing on Button 1, I clicked F7 and then at F8 for it to return all the records, because the first time it opened the test forms I did here, it was in INSERT mode.

With F7 and F8 he also asks to save or is it only with the buttons?
douglasmattos
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 75
Joined: Mon, 19 Mar 2012 2:28 pm

Dude,
asks only to save with the buttons. If I press F7 and F8 goes well.
performs the search and returns only the data regarding the value I typed.
User avatar
tiago_pimenta
Rank: DBA Júnior
Rank: DBA Júnior
Posts: 213
Joined: Wed, 29 Jun 2011 9:49 am
Location: Barretos / SP

What triggers does this block have?
douglasmattos
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 75
Joined: Mon, 19 Mar 2012 2:28 pm

I think it's a problem with my data block ..... because what you said is right. It was to work.
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests