Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a seachable page

Status
Not open for further replies.

teferi2002

Technical User
Sep 24, 2005
81
0
0
US
Hi all,
I am assigned to create an application for our external and internal customers to be able do searching on our vendor list page. I came up with quick simple solution for the customers to do searching using a selected state. If you are kind enough and check the below link you will know what I mean.

My question to use is how I can make another selection for the customer just to enter a full vendor name or part of the vendor name and be able get the desired vendor name. Can some one give a clue how I can accomplish this task. Will it help If I post my sql script. Thank you
 
You should create a stored procedure that accepts a search string and then adds a WHERE clause for that string (you can also use wildcards for partial matches).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thank you ca8msm for quick response. So, this can only be done using a procedure? I do not have a previlage to create a procedure. Can I do this just using sql script without creating a procedure. Hope I did provide enough info. for you to help me. I really appreciate your time and help.

v.vnamel is the field for vendor name.


SELECT DISTINCT
V.VENDOR ,
R.ADDRNUM,
V.VNAMEL,
R.AADDR1,
R.ACITY,
R.ASTATE,
R.AZIPCODE,
R.APHONE,
TO_Char( (MAX(P.DATEPUR)), 'YYYY-MM-DD') as Purchase_Date
FROM VENDOR V,
VENDADDR R,
PLANHOLD P
WHERE V.VENDOR = R.VENDOR AND
P.VENDOR = R.VENDOR AND
(P.DATEPUR >= TO_DATE('2002-01-01','YYYY-MM-DD') )
AND V.VOBSOLET = 'N'
 
Yes, you can just use dynamic sql


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thank you ca8msm again. How do you convert the above sql to dynamic sql. Can you provide any clue for me. thanks again
 
The above is already what I was referring to as dynamic sql (as opposed to being an SP).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
something like this...below is just a pseudo code...

Code:
sql = " SELECT blah from mytable" & _
      " where state='" &txtstate.text& "' "
if txtvname.text<>"" then
sql = sql & " AND VendorName='" &txtvname.text& "'"
end if

-DNG
 
Thank you for clarifying that for me. I will paly with it and et you know the outcome. thank you again for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top