From: | "Derrick Betts" <derrick(at)grifflink(dot)com> |
---|---|
To: | <KeithW(at)narrowpathinc(dot)com>, <pgsql-novice(at)postgresql(dot)org> |
Subject: | Re: Search function |
Date: | 2005-06-23 04:22:19 |
Message-ID: | 00a001c577ab$2772b8f0$0202a8c0@main |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
I have built search functions for web pages that build the SQL string
dynamically and return the result from a function through a result set. For
example, your form may have three input fields with several "options" the
user can search with: Date_To: (an input field) Date From: (an input field)
Destination: (a drop down list with airport codes).
Your SQL would look like: "SELECT * FROM table WHERE date1 >=
Date_To_variable_from_the_form AND date2 <= Date_From_variable_from_the_form
AND destination = Destination_from_the_form.
You would then execute the statement and return the results to your
application.
Is this what you were looking for?
Derrick
----- Original Message -----
From: "Keith Worthington" <KeithW(at)narrowpathinc(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Sent: Wednesday, June 22, 2005 8:55 PM
Subject: [NOVICE] Search function
> Hi All,
>
> I am working on an application that has a search dialog. The dialog is
> automatically populated with all of the available fields. It gets the
> field names from the views that were used on the form that the search
> dialog was launched from.
>
> The issue that is slowly getting unmanageable is handling the different
> data types. If it is a date do this, if it is a string do that and if it
> is a boolean do something else.
>
> I would like to remove this complexity from the application.
>
> I am hoping that there is a way given the view/column names that I can
> either
> 1) dynamically build the WHERE clause
> 2) dynamically build the whole query
> 3) dynamically build the whole query, run it and return the results
>
> Has anyone tried something like this before?
>
> --
> Kind Regards,
> Keith
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Prashant | 2005-06-23 06:22:39 | UNSUBSCRIB pgsql-novice |
Previous Message | Keith Worthington | 2005-06-23 02:55:07 | Search function |