Subject | Re: [IBO] Simple parameter query question |
---|---|
Author | Hans |
Post date | 2007-02-12T05:25:42Z |
1. select from table where Customer_ID like '%' and Document_Type like '%'
2. select from table where Customer_ID like '44'' and Document_Type like
'25'
3 select from table where Customer_ID like '%' and Document_Type like '25'
will do that, I think
2. select from table where Customer_ID like '44'' and Document_Type like
'25'
3 select from table where Customer_ID like '%' and Document_Type like '25'
will do that, I think
----- Original Message -----
From: "mitch_landor" <mlq97@...>
To: <IBObjects@yahoogroups.com>
Sent: Sunday, February 11, 2007 5:56 PM
Subject: [IBO] Simple parameter query question
> Not sure if this is a Delphi or IB question but here goes:
>
> I want a query that always obtains the same columns from a table/s,
> but which uses different parameters in different situations.
>
> Example 1:
> Return all rows
>
> Example 2:
> Customer ID = 44
> Document Type = 25
>
> Example 3:
> Customer ID = all
> Document Type = 25
>
> I know that one can create a paramter in a query and then reference it
> using parambyname, but how can I create a single query that will for
> example allow CustomerID
> sometimes to return "44" and sometimes to return all rows? What is the
> parameter for "all"?
>
> Really I'm looking for a way to use an "all" parameter so I can get
> all result permutations using only one base query by always passing
> all the possible parameters, rather than having to create lots of
> separate queries.
>
> Thanks
>
> Mitch
>
>
>
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
> papers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links
>
>
>