Skip to main content



      Home
Home » Archived » BIRT » optinal Parameter and SQL Query
optinal Parameter and SQL Query [message #171384] Mon, 19 June 2006 07:20 Go to next message
Eclipse UserFriend
Originally posted by: vincent.tiberghien.ird.sn

Hello,
I am setting up a data set with a SQL Query.
In that query, i use a parameter to select either mens or womens, like this

SELECT people
WHERE sex=?

Sex can be equal to 1(men) or 2(women).
Users will be deciding the value of this parameter. But i also would
like them to be able to choose the 'no matter' case where both mens and
womens would be selected, like this

SELECT people

there would not be any WHERE clause.
How can i do that ?
thank you
Re: optinal Parameter and SQL Query [message #171442 is a reply to message #171384] Mon, 19 June 2006 16:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: a.bcd.com

vincent tiberghien wrote:
> Hello,
> I am setting up a data set with a SQL Query.
> In that query, i use a parameter to select either mens or womens, like this
>
> SELECT people
> WHERE sex=?
>
> Sex can be equal to 1(men) or 2(women).
> Users will be deciding the value of this parameter. But i also would
> like them to be able to choose the 'no matter' case where both mens and
> womens would be selected, like this
>
> SELECT people
>
> there would not be any WHERE clause.
> How can i do that ?
> thank you

Hello ,
you could try :
select people where sex like ?

and default the 1st param to %
Re: optinal Parameter and SQL Query [message #171447 is a reply to message #171384] Mon, 19 June 2006 21:00 Go to previous messageGo to next message
Eclipse UserFriend
Define your SQL to be: SELECT people WHERE sex = ? OR ?=0
Bind both data set parameters to the same report parameter in BIRT. Then:
param value 1->men, 2->women, 0-> both

--
Gary Xue
Actuate Corporation - Product Development
BIRT Committer
"vincent tiberghien" <vincent.tiberghien@ird.sn> wrote in message
news:e761fh$gdk$1@utils.eclipse.org...
> Hello,
> I am setting up a data set with a SQL Query.
> In that query, i use a parameter to select either mens or womens, like
this
>
> SELECT people
> WHERE sex=?
>
> Sex can be equal to 1(men) or 2(women).
> Users will be deciding the value of this parameter. But i also would
> like them to be able to choose the 'no matter' case where both mens and
> womens would be selected, like this
>
> SELECT people
>
> there would not be any WHERE clause.
> How can i do that ?
> thank you
Re: optinal Parameter and SQL Query [message #184584 is a reply to message #171384] Mon, 14 August 2006 08:21 Go to previous message
Eclipse UserFriend
Originally posted by: harunhasdal.gmail.com

vincent tiberghien wrote:
> Hello,
> I am setting up a data set with a SQL Query.
> In that query, i use a parameter to select either mens or womens, like this
>
> SELECT people
> WHERE sex=?
>
> Sex can be equal to 1(men) or 2(women).
> Users will be deciding the value of this parameter. But i also would
> like them to be able to choose the 'no matter' case where both mens and
> womens would be selected, like this
>
> SELECT people
>
> there would not be any WHERE clause.
> How can i do that ?
> thank you

You can write a beforeOpen script to your dataset and modify the query
by changing queryText variable freely before execution.
Previous Topic:Reuse query defined in "Data Set - Query"
Next Topic:Reloading a report with new values for parameters
Goto Forum:
  


Current Time: Sun May 11 14:35:31 EDT 2025

Powered by FUDForum. Page generated in 0.03881 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top