Subject Custom search string
Author Grant Brown
Hi to all,

Using FB 1.5 and Delphi 5.

I need to create a custom search string in a stored procedure subject to
the fields that the user has selected.

To explain more,

On a particular form in our application we have 10 user input devices,
some are standard edit boxes, some are drop down lists.

I need the "where" clause of the stored procedure to cope with this set
up subject to what ever the user has selected.

If I was creating a normal sql query statement then I could just add
together the required bits and end up with the final "where" clause.

eg -
ABC.SQL.Add('where Detect= :123);
if X = true then ABC.SQL.Add('and Text1= :T1);
if C = true then ABC.SQL.Add('and Text2= :T2);

and so on and so on until I get the final "where" clause for the query.

My question is how do I set up a stored procedure that could be created
at runtime ?

Is this do able or can I only do this with "querys" and then send the
whole query to the DB server.

--
Regards,
Grant Brown

Product Development Manager
Phone : 02 4229 1185
Mobile : 0412 926 995
Email : grant@...
Web : www.sitedoc.com.au

SiteDoc - Easy to Use - Powerful Results