[ic] Filtering by manufacturer

daniel castro daniel_castro at hotmail.com
Tue Aug 3 18:10:05 EDT 2004


Hi list,
I am using IC 5.0.1, Linux Debian, kernell  2.4.18-bf2.4, PostgreSQL 7.4.2, 
perl 5.8.3

Here is what Iam trying to do,  I am trying to filter by manufacturer in a 
search by category, I have tryed by diferent things, that seems to work, for 
example, if I use a SQL statement, it show exactly what I want.
SELECT * FROM products p WHERE upper(p.category) like upper('%Operating 
Systems%') AND upper(p.manufacturer) like upper('%IBM%');

In this case, it shows you a single result, and that is what it is supposed 
to show,now the problem, I have the following code: it is supposed to do 
exactly the same as the sql statement.


<!-- STARTS DROP DOWN LIST MANUFACTURERS -->
Filter by Manufacturer:  </b>
<FORM ACTION="search" METHOD=POST>
<INPUT TYPE=hidden NAME=mv_session_id VALUE=[data session id]>
<INPUT TYPE=hidden NAME=mv_search_file VALUE=products>
<INPUT TYPE=hidden NAME=mv_searchtype VALUE=db>
<INPUT TYPE=hidden NAME=mv_search_page VALUE=results>
<INPUT TYPE=hidden NAME=mv_coordinate VALUE=1>
<INPUT TYPE=hidden NAME=mv_search_field VALUE=category>
<INPUT TYPE=hidden NAME=mv_searchspec VALUE="[value-extended 
mv_searchspec]">
<INPUT TYPE=hidden NAME=mv_column_op VALUE=rm>
<INPUT TYPE=hidden NAME=mv_numeric VALUE=0>
<INPUT TYPE=hidden NAME=mv_search_field VALUE=manufacturer>
<INPUT TYPE=hidden NAME=mv_column_op VALUE=rm>
<INPUT TYPE=hidden NAME=mv_numeric VALUE=0>
<SELECT NAME=mv_searchspec onChange=this.form.submit()>
<OPTION VALUE='*'>ALL</OPTION>
[SQL type=list query="
SELECT manufacturer
FROM products
WHERE upper(products.category) like upper('%[value-extended 
mv_searchspec]%')
GROUP BY manufacturer
"]
<OPTION VALUE="[sql-param manufacturer]">[sql-param manufacturer]</OPTION>
[/SQL]
</SELECT></FORM><!--END DROP DOWN LIST MANUFACTURER--></td></TR>


Ok, that simply shows a drop down list with all the manufacturers from a 
given category, the funny thing about that, is that when you use it, it 
shows very difrent results, compared with the SQL statement, but It seems 
correct to me, I say this because we use the same thing but filtering for 
category instead of manufacturer, and it works like a charm.

Any commentor help, will be apreciated.
Thanks
Daniel Castro

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



More information about the interchange-users mailing list