Home » Developer & Programmer » Forms » forms/search error
forms/search error [message #82397] Sat, 24 May 2003 04:55 Go to next message
jels
Messages: 29
Registered: April 2003
Junior Member
the error is corrected but its not working the selected item is not going to search_pattern
when i am pressing the shift + f1 i am getting this message
SELECT ROWID,PRODUCT_NO,DESCRIPTION,PROFIT_PERCENT,QTY_ON_HAND,REORDER_LVL,SELL_PRICE,COST_PRICE,UNIT_MEASRUE FROM PRODUCT_MASTER WHERE PRODUCT_NO = " P06734"

ORA-00904: invalid column name
but the column name is correct the the selected itme is not going to text box whteher i have to set any properties

i wrote this code in pre_form level

pre_form
declare
rg varchar(40) := 'SEARCH_LIST';
groupid recordgroup;
status number;
begin
groupid := create_group_from_query(rg,'select product_no,product_no from product_master');
status := populate_group(groupid);
populate_list('SEARCH_LIST',groupid);
end;



2 when button pressed search_button
begin

call_form('e:jelsfomssearch.fmx',no_hide);
if not(:global.search_value= ' ')then


set_block_property('product_master',default_where,'where product_no = " ' ||:global.search_value||'"');

go_block('product_master');
execute_query;
set_block_property('product_master',default_where, '');
end if;
end;

3 when _validate_item search_pattern
declare
rg varchar(40) := 'SEARCH_LIST';
groupid recordgroup;
status number;
begin
groupid := find_group(rg);
if not id_null(groupid) then
if :search_pattern = '' or :search_pattern is null then
status := populate_group_with_query(rg,'select product_no,product_no from product_master');
else
status := populate_group_with_query(rg,'select product_no,product_no from product_master where lower(product_no) like
lower("'|| :search_pattern || '% ")');
end if;
populate_list('SEARCH_LIST',groupid);
end if;
end;
pls hlp
jels
Re: forms/search error [message #82413 is a reply to message #82397] Mon, 26 May 2003 02:29 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Ah, this isn't that hard. You've used double quotes in the where clause. These should be single quotes:

So instead of :
set_block_property('product_master',default_where,'where product_no = " ' ||:global.search_value||'"');
try the following:
set_block_property('product_master',default_where,'where product_no = <B><FONT COLOR=RED>''</FONT></B> ' ||:global.search_value||'<B><FONT COLOR=RED>''</FONT></B>');
The red code are TWO single quotes: the first will escape the second so that Oracle doesn't interpret it as being the beginning/end of a string, but treats the two of them as one single quote literal.

MHE
Previous Topic: displaying icon in smartbar
Next Topic: Connection
Goto Forum:
  


Current Time: Sat Apr 20 09:30:17 CDT 2024