Home » Developer & Programmer » Forms » problem in useing LIKE in Enter_Query Mode
problem in useing LIKE in Enter_Query Mode [message #142023] Thu, 13 October 2005 03:56 Go to next message
esmat_shoja
Messages: 8
Registered: August 2005
Junior Member
hi all

in my form i had this:
in execute_query trigger i have:
-----------------------------------------------------------------
 if  :system.mode='ENTER-QUERY' then 
     set_block_property('block_name',default_where,make_search_str);
 end if;                                                                                
 EXECUTE_QUERY(NO_VALIDATE);

-----------------------------------------------------------------
FUNCTION [b]make_search_str [/b]RETURN char IS
str varchar2(1000);
BEGIN

if :number_item  is not null then                                                      
   str:=str || ' col1='||:number_item ||' and';                                                          
end if;                                                                                
if :NAME is not null then   
   str:=str ||'  name like ''%' ||:name  ||'%'' and';                                                     
end if;                                                                                
str=substr(str,1,length(str)-3);                                                                             
return(str);
END;

but when I enter F7 anf fill :name then I enter F8 ,no record ?
any help woul be appteciated.

Upd-mod: Add code tags

[Updated on: Thu, 13 October 2005 18:18] by Moderator

Report message to a moderator

Re: problem in useing LIKE in Enter_Query Mode [message #142055 is a reply to message #142023] Thu, 13 October 2005 06:11 Go to previous messageGo to next message
kiran
Messages: 503
Registered: July 2000
Senior Member
was there any error message displayed?

--Kiran.

[Updated on: Thu, 13 October 2005 06:12]

Report message to a moderator

Re: problem in useing LIKE in Enter_Query Mode [message #142216 is a reply to message #142055] Thu, 13 October 2005 18:19 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
What version of Forms and Database are you using?

Via TOAD or DBA Studio have a look at the query SQL and put it in your next post.

David
Re: problem in useing LIKE in Enter_Query Mode [message #142500 is a reply to message #142055] Fri, 14 October 2005 22:52 Go to previous messageGo to next message
esmat_shoja
Messages: 8
Registered: August 2005
Junior Member
unable to perform query.
i think the problem is in using this sigh ( ' ) in makin str.
Re: problem in useing LIKE in Enter_Query Mode [message #142504 is a reply to message #142023] Fri, 14 October 2005 23:36 Go to previous messageGo to next message
naveednt
Messages: 34
Registered: October 2005
Location: Karachi, Pakistan
Member
if :system.mode='ENTER-QUERY' then
set_block_property('block_name',default_where,make_search_str);
end if;
-- ADD THIS LINE IN YOUR CODE --
clear_record;
--------AND HAVE FUN -----------
EXECUTE_QUERY(NO_VALIDATE);
Re: problem in useing LIKE in Enter_Query Mode [message #142541 is a reply to message #142504] Sat, 15 October 2005 04:32 Go to previous messageGo to next message
esmat_shoja
Messages: 8
Registered: August 2005
Junior Member
thank you very much.
i used clear_block
and my problem was solved.
but what is the reason ?
thanks in advance.
Re: problem in useing LIKE in Enter_Query Mode [message #142542 is a reply to message #142541] Sat, 15 October 2005 04:51 Go to previous messageGo to next message
naveednt
Messages: 34
Registered: October 2005
Location: Karachi, Pakistan
Member
user takes the form into enter-query mode by pressing F7
after that user writes down a value in a field (let suppose ENAME),

user entered 'SMI' in field ENAME

before executing query you changed the default where condition of block into

where ENAME like '%SMI%'

+ values that are written in the field on screen

so at last we have two conditions in the where clause

where ename like '%SMI%'
and ename = 'SM'
Re: problem in useing LIKE in Enter_Query Mode [message #142568 is a reply to message #142542] Sun, 16 October 2005 00:59 Go to previous message
esmat_shoja
Messages: 8
Registered: August 2005
Junior Member
Hi
Thank You Very Much.
Bbest Regards.
Previous Topic: Developer
Next Topic: invoking pop-up window
Goto Forum:
  


Current Time: Fri Sep 20 10:42:10 CDT 2024