Keep Where statement as "default where" when you re query

Scenario :
1- User presses enter query button
2- user enter the criteria and the presses "Execute Query" button
3- Data for the specified criteria is now displayed on the block
4- user wants now to order data ascending , so he presses "Order ASC" button which contains this code
"set_block_property('data",default_where,vColumn||' '||'asc');
Execute_query;"
5-The block now displays all the data form the table in a ascending order
requirement:
user wants to display only the data with the previous specified criteria in an ascending order
--------------------------------------------------
DECLARE
v_qry varchar2(1000);
v_where varchar2(1000);
m number;
n number;
BEGIN
csh$block.all_Rec('DATA','QF_BROWSE',:SWITCH,'CSH_ENTER',:ACTION_FLAG);
If csh$block.check_records(':browse.status',:action_flag,:switch,'CSH_ENTER','T')>0 then
v_qry:=get_block_property('BROWSE',last_query);
qms$block.go('DATA');
--set_block_property('DATA',default_where,'jv_type =''PV''');
m:=instr(v_qry,'WHERE');
n:=instr(upper(v_qry),'ORDER BY');
if m>0 then
v_where:=substr(v_qry,m+6,(n-(m+6)));
end if;
set_block_property('DATA',default_where,v_where);
v_qry:=get_block_property('DATA',default_where);
qms$menu.set_current_action('EXECUTE_QUERY');
execute_trigger('QMS$MENU_ITEM');
END IF;
end;
--------------------------------------------------------------------

Comments

Popular posts from this blog

Another user has changed the row with primary key oracle.jbo.Key[12 ].

Working With File Throgh WebUtill

Reading From File