On a form i have 2 pages,on one page i have 4 tables, atext item and a button, i want to execute a query when i pres the button.
When i pres the button first time it enters query mode when i pres the button second time it doesn't do anything
Here is the code:



declare

def_where varchar2(20);

nr_c_cititor number(2);

begin
go_block('cititor');

if :blk.cit_cod_cititor is null then
begin
message('Introduceti codul cititorului pentru cautare');
message('Introduceti codul cititorului pentru cautare');
end;
else
begin
select count(cod_cititor) into nr_c_cititor
from scott.cititor@serv.horo.local a
where a.cod_cititor=:blk.cit_cod_cititor;
if nr_c_cititor=0 then
begin
message('Cititorul nu exista');
message('Cititorul nu exista');
end;
else
begin
def_where:='cod_cititor='||:blk.cit_cod_cititor;
message('Cititor');
message('Cititor');

IF :System.Mode='NORMAL' THEN

go_block('cititor');
enter_query;
set_block_property('cititor', DEFAULT_WHERE, def_where);


else

go_block('cititor');
execute_query;

end if;


end;
end if;
end;
end if;

end;