Home » Developer & Programmer » Forms » Execute query by pressing a button
Execute query by pressing a button [message #536723] Thu, 22 December 2011 06:41 Go to next message
enggnitinjain86gmailco
Messages: 3
Registered: October 2010
Location: delhi
Junior Member

Hi all I have two data block but i want to execute_query () ; by button when i press the button one data block record display Please help me
Re: Execute query by pressing a button [message #536729 is a reply to message #536723] Thu, 22 December 2011 06:50 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm not sure I understood the question; what is the problem? Did you create a button and put EXECUTE_QUERY; into its WHEN-BUTTON-PRESSED trigger? What then? You push the button and only one block is populated with data?

How are these blocks related? Master-detail, perhaps? If so, and if query doesn't return anything in a detail block, then you didn't create relationship properly (I'd suggest you to use data block wizard to do that), or there are no detail records for fetched master record.

If they are not related, then you'll have to modify the trigger:
go_block('first_block');
execute_query;

go_block('second_block');
execute_query;
Re: Execute query by pressing a button [message #552888 is a reply to message #536729] Mon, 30 April 2012 01:11 Go to previous messageGo to next message
enggnitinjain86gmailco
Messages: 3
Registered: October 2010
Location: delhi
Junior Member

Hi
I have two form and in form 1 i added one button and when i press the button then form 1 parameter pass in form 2 nd parameter of forms 1 is text_item ,
i used code when_button_press /
declare
v_user_id user_mast.user_id%type ;
v_user_pass user_mast.user_pass%type ;
ans number ;
Param_List_Name VARCHAR2(20) := 'WHERE_LIST';
Param_List_Id PARAMLIST;
begin
v_user_id := null ;
v_user_pass := null ;
begin
select
user_id,
user_pass
into
v_user_id,
v_user_pass
from
user_mast
where
user_id = rtrim(ltrim(:user_mast.user_id)) and
user_pass = rtrim(ltrim(:user_mast.user_pass)) ;
exception
when no_data_found then
null ;
end;

if v_user_id is null and v_user_pass is null then
set_alert_property('stop_alert',alert_message_text, 'Please enter The Valid ID/PASS') ;
ans := show_alert('stop_alert') ;
else


Param_List_Id := GET_PARAMETER_LIST(Param_List_Name);

IF NOT ID_NULL(Param_List_Id) THEN

DESTROY_PARAMETER_LIST(Param_List_Id);

END IF;

Param_List_Id := CREATE_PARAMETER_LIST(Param_List_Name);
ADD_PARAMETER(Param_List_Id,'REG_QUERY',TEXT_PARAMETER, :USER_ID);

--- here WHERE is the parameter AND USER_NUM is the value of User No

CALL_FORM ('GHPL_INVOICE',HIDE, DO_REPLACE, NO_QUERY_ONLY ,Param_List_Id);
--EXIT_FORM ;


end if;


end;


---------------------------------

And in this code i want to pass user_id and this user id pass form to from

But i want to pass from menu Item

Sir Please help me its very urgent ..
Re: Execute query by pressing a button [message #552889 is a reply to message #552888] Mon, 30 April 2012 01:14 Go to previous messageGo to next message
enggnitinjain86gmailco
Messages: 3
Registered: October 2010
Location: delhi
Junior Member

and this code i use in menu item

DECLARE
param_list_id ParamList;
REG_QUERY VARCHAR2(10) := :global.user_id ;
BEGIN
IF REG_QUERY IS NOT NULL THEN
param_list_id := GET_PARAMETER_LIST('TMPDATA');
IF NOT ID_NULL(param_list_id) THEN
DESTROY_PARAMETER_LIST('TMPDATA');
END IF;
param_list_id := CREATE_PARAMETER_LIST('TMPDATA');
ADD_PARAMETER(param_list_id, 'REG_QUERY', TEXT_PARAMETER, :global.user_id );
CALL_FORM ('GHPL_INVOICE',HIDE,DO_REPLACE,NO_QUERY_ONLY,param_list_id);
DESTROY_PARAMETER_LIST(param_list_id);
END IF;
END;
Re: Execute query by pressing a button [message #552893 is a reply to message #552888] Mon, 30 April 2012 01:29 Go to previous message
Michel Cadot
Messages: 68666
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.

Regards
Michel
Previous Topic: Oracle forms
Next Topic: what trigger to use?
Goto Forum:
  


Current Time: Fri Jul 05 22:02:36 CDT 2024