Home » Archived » BIRT » Multiple SQL queries with mysql
| |
Re: Multiple SQL queries with mysql [message #264934 is a reply to message #264930] |
Wed, 23 January 2008 10:07 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
That's a shame then.
I can't use stored procedures or a scripted data source, and I find usin=
g =
parameters quite painfull:
You have to insert question marks in your query and then you need to lin=
k =
each and single question mark to a report parameter. Which means that:
- Every time you modify your query and add or remove a qustion mark then=
=
you have to do the whole linking all over again. If you have a few =
parameters it's ok, but if you have loads then it becomes a pain.
- When you need to use multiple times the same paramteters you have to d=
o =
the linking multiple times anyway even though it is the same parameter y=
ou =
use several times. For example:
SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ? AND =
field4 < ?;
All question marks must be linked to the same parameter, say =
params['report_param1'], but I will have to create 4 parameter linkings =
=
for that anyway.
- You can't just copy the text of your query to create a new one since y=
ou =
will have to redo the linking all over again.
I would love to be able to do something like this:
"SELECT * FROM table WHERE field1 < params['report_param1'] AND field2 <=
=
params['report_param1'];"
Nice and simple, directly in the SQL query editor, but unless I haven't =
=
still figured it out, this does not seem to be possible with BIRT.
So I thought I would do that instead:
"SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND field2=
< =
@param1;"
And link the first question mark only once to "params['report_param1']",=
=
but that doesn't work either.
A bit of user friendliness is needed I guess.
Any tips on this?
Thanks
On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> BIRT can't run multiple queries. You can use either parameters, stored=
=
> procedures or a scripted data source.
>
> Snjeza
>
> serbenet wrote:
>> Hi all,
>> I am trying to run the following query with BIRT connected to a mysq=
l =
>> database :
>> SET @value:=3D2;
>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>> In theory the query should work but for some reasons BIRT gives me a=
n =
>> error:
>> A BIRT exception occurred.
>> Plug-in Provider:Eclipse.org
>> Plug-in Name:BIRT Data Engine
>> Plug-in ID:org.eclipse.birt.data
>> Version:2.2.1.r22x_v20070925
>> Error Code:odaconsumer.CannotGetResultSetMetaData
>> Error Message:Cannot get the result set metadata.
>> SQL statement does not return a ResultSet object.
>> SQL error #1: You have an error in your SQL syntax; check the manual =
=
>> that corresponds to your MySQL server version for the right syntax to=
=
>> use near ';SELECT * FROM table1 WHERE field1 < @value' at line 1
>> Any ideas on how to solve the issue?
>> It it possible to do what I am trying with BIRT?
>> Thanks.
>>
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #264935 is a reply to message #264934] |
Wed, 23 January 2008 14:54 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Philipp Tiedt![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=philipp.tiedt%40web.de) Messages: 52 Registered: July 2009 |
Member |
|
|
serbenet wrote:
> That's a shame then.
>
> I can't use stored procedures or a scripted data source, and I find
> using parameters quite painfull:
> You have to insert question marks in your query and then you need to
> link each and single question mark to a report parameter. Which means that:
> - Every time you modify your query and add or remove a qustion mark then
> you have to do the whole linking all over again. If you have a few
> parameters it's ok, but if you have loads then it becomes a pain.
> - When you need to use multiple times the same paramteters you have to
> do the linking multiple times anyway even though it is the same
> parameter you use several times. For example:
>
> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ? AND
> field4 < ?;
>
> All question marks must be linked to the same parameter, say
> params['report_param1'], but I will have to create 4 parameter linkings
> for that anyway.
>
> - You can't just copy the text of your query to create a new one since
> you will have to redo the linking all over again.
>
>
> I would love to be able to do something like this:
>
> "SELECT * FROM table WHERE field1 < params['report_param1'] AND field2 <
> params['report_param1'];"
>
> Nice and simple, directly in the SQL query editor, but unless I haven't
> still figured it out, this does not seem to be possible with BIRT.
>
> So I thought I would do that instead:
> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND field2 <
> @param1;"
> And link the first question mark only once to "params['report_param1']",
> but that doesn't work either.
>
> A bit of user friendliness is needed I guess.
>
> Any tips on this?
>
> Thanks
>
>
> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
> <snjeza.peco@gmail.com> wrote:
>
>> BIRT can't run multiple queries. You can use either parameters, stored
>> procedures or a scripted data source.
>>
>> Snjeza
>>
>> serbenet wrote:
>>> Hi all,
>>> I am trying to run the following query with BIRT connected to a
>>> mysql database :
>>> SET @value:=2;
>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>> In theory the query should work but for some reasons BIRT gives me
>>> an error:
>>> A BIRT exception occurred.
>>> Plug-in Provider:Eclipse.org
>>> Plug-in Name:BIRT Data Engine
>>> Plug-in ID:org.eclipse.birt.data
>>> Version:2.2.1.r22x_v20070925
>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>> Error Message:Cannot get the result set metadata.
>>> SQL statement does not return a ResultSet object.
>>> SQL error #1: You have an error in your SQL syntax; check the manual
>>> that corresponds to your MySQL server version for the right syntax to
>>> use near ';SELECT * FROM table1 WHERE field1 < @value' at line 1
>>> Any ideas on how to solve the issue?
>>> It it possible to do what I am trying with BIRT?
>>> Thanks.
>>>
>
>
>
Could you try and use the property binding tab in the data set to model
your query? You could use the Expression builder to create a query
directly using your params.
Its a bit of a workarround but might do. Specify your select query in
the query tab without specifying the where clause. The copy that query
to the property binding tab query text field and use the expression
builder to add the where clause using your params. Maybe :-)
Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #264936 is a reply to message #264935] |
Wed, 23 January 2008 16:27 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
I believe that the property binding is used to select a subsample of the=
=
datas after the dataset was retrieved from the datasource.
For efficiency purpose (since I'm working on big datas set), I want the =
=
full query (including the where clause) to be executed on the database =
server so that I can make use of the indexing. If I use the property =
binding for the where clause then most of the job will be achieved by th=
e =
report engine and this is going to be too slow.
I would need something similar to the property binding where I can =
dynamically build the SQL query using javascript functions, before =
execution by the database server.
On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>=
=
wrote:
> serbenet wrote:
>> That's a shame then.
>> I can't use stored procedures or a scripted data source, and I find =
=
>> using parameters quite painfull:
>> You have to insert question marks in your query and then you need to =
=
>> link each and single question mark to a report parameter. Which means=
=
>> that:
>> - Every time you modify your query and add or remove a qustion mark =
>> then you have to do the whole linking all over again. If you have a f=
ew =
>> parameters it's ok, but if you have loads then it becomes a pain.
>> - When you need to use multiple times the same paramteters you have t=
o =
>> do the linking multiple times anyway even though it is the same =
>> parameter you use several times. For example:
>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ? A=
ND =
>> field4 < ?;
>> All question marks must be linked to the same parameter, say =
>> params['report_param1'], but I will have to create 4 parameter linkin=
gs =
>> for that anyway.
>> - You can't just copy the text of your query to create a new one sin=
ce =
>> you will have to redo the linking all over again.
>> I would love to be able to do something like this:
>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND fiel=
d2 =
>> < params['report_param1'];"
>> Nice and simple, directly in the SQL query editor, but unless I =
>> haven't still figured it out, this does not seem to be possible with =
=
>> BIRT.
>> So I thought I would do that instead:
>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND fie=
ld2 =
>> < @param1;"
>> And link the first question mark only once to =
>> "params['report_param1']", but that doesn't work either.
>> A bit of user friendliness is needed I guess.
>> Any tips on this?
>> Thanks
>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>> <snjeza.peco@gmail.com> wrote:
>>
>>> BIRT can't run multiple queries. You can use either parameters, stor=
ed =
>>> procedures or a scripted data source.
>>>
>>> Snjeza
>>>
>>> serbenet wrote:
>>>> Hi all,
>>>> I am trying to run the following query with BIRT connected to a =
>>>> mysql database :
>>>> SET @value:=3D2;
>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>> In theory the query should work but for some reasons BIRT gives me=
=
>>>> an error:
>>>> A BIRT exception occurred.
>>>> Plug-in Provider:Eclipse.org
>>>> Plug-in Name:BIRT Data Engine
>>>> Plug-in ID:org.eclipse.birt.data
>>>> Version:2.2.1.r22x_v20070925
>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>> Error Message:Cannot get the result set metadata.
>>>> SQL statement does not return a ResultSet object.
>>>> SQL error #1: You have an error in your SQL syntax; check the manua=
l =
>>>> that corresponds to your MySQL server version for the right syntax =
to =
>>>> use near ';SELECT * FROM table1 WHERE field1 < @value' at line 1
>>>> Any ideas on how to solve the issue?
>>>> It it possible to do what I am trying with BIRT?
>>>> Thanks.
>>>>
>>
> Could you try and use the property binding tab in the data set to mode=
l =
> your query? You could use the Expression builder to create a query =
> directly using your params.
>
> Its a bit of a workarround but might do. Specify your select query in =
=
> the query tab without specifying the where clause. The copy that query=
=
> to the property binding tab query text field and use the expression =
> builder to add the where clause using your params. Maybe :-)
>
> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #264970 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #264996 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #265009 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #265682 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #265705 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #265716 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #266393 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #266422 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #266434 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #267121 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #267147 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #267159 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #267827 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #267851 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #267864 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #268537 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #268560 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #268571 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #269254 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #269278 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #269289 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #269976 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #270002 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #270015 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #270680 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #270706 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #270719 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #271400 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #271427 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #271437 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #272133 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #272158 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #272172 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #272727 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #272745 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #272752 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #273060 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #273068 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #273072 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #273477 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #273493 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #273501 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #273878 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #273895 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #273905 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #274260 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #274275 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #274282 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #274649 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #274665 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #274674 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #275040 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #275055 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #275063 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #275434 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #275448 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #275457 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #275833 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #275850 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #275857 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #276222 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #276240 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #276248 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #276623 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #276638 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #276647 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #277023 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #277040 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #277049 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #277412 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #277421 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #277430 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #277824 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #277840 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #277847 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #278200 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #278215 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #278221 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #278600 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #278614 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #278622 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #278993 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #279010 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #279018 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #279411 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #279428 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #279436 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #279786 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #279799 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #279806 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #280176 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #280192 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #280199 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #280573 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #280587 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #280594 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #280968 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #280984 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #280992 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #281369 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #281384 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #281391 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #281758 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #281775 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #281783 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #282149 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #282165 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #282173 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #282548 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #282563 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #282570 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #282943 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #282958 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #282966 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #283338 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #283356 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #283364 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #283730 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #283745 is a reply to message #264970] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #283755 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #284128 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #284145 is a reply to message #284128] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #284153 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #284524 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #284538 is a reply to message #284524] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #284544 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #284914 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #284930 is a reply to message #284914] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #284937 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #285309 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #285317 is a reply to message #285309] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #285321 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #285802 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #285818 is a reply to message #285802] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #285826 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #286153 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #286169 is a reply to message #286153] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #286178 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #286499 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #286516 is a reply to message #286499] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #286525 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #286907 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #286926 is a reply to message #286907] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #286937 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #287284 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #287292 is a reply to message #287284] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #287296 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #287683 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #287698 is a reply to message #287683] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #287707 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #288079 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #288095 is a reply to message #288079] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #288104 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #288471 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #288488 is a reply to message #288471] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #288496 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #288865 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #288882 is a reply to message #288865] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #288890 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #289262 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #289278 is a reply to message #289262] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #289286 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #289660 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #289676 is a reply to message #289660] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #289683 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #290049 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #290062 is a reply to message #290049] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #290070 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #290444 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #290458 is a reply to message #290444] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #290466 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #290846 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #290861 is a reply to message #290846] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #290871 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #291239 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #291255 is a reply to message #291239] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #291264 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #291634 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #291651 is a reply to message #291634] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #291659 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #292024 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #292037 is a reply to message #292024] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #292045 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #292425 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #292440 is a reply to message #292425] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #292449 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #292821 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #292838 is a reply to message #292821] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #292846 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #293211 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #293228 is a reply to message #293211] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #293236 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #293610 is a reply to message #264936] |
Wed, 23 January 2008 21:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Snjezana Peco![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=snjezana.peco%40redhat.com) Messages: 789 Registered: July 2009 |
Senior Member |
|
|
You can change the query in the beforeOpen method as follows:
this.queryText=...
Snjeza
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Re: Multiple SQL queries with mysql [message #293626 is a reply to message #293610] |
Thu, 24 January 2008 09:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
serbenet![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=serbenet%40free.fr) Messages: 517 Registered: July 2009 |
Senior Member |
|
|
Nice trick I've just tried it and that works. It's not very practical an=
d =
user friendly though.
It would be nice to be able to do the same thing directly from the data =
=
set editor.
Thanks
On Wed, 23 Jan 2008 21:14:04 -0000, Snjezana Peco <snjeza.peco@gmail.com=
> =
wrote:
> You can change the query in the beforeOpen method as follows:
> this.queryText=3D...
>
> Snjeza
>
> serbenet wrote:
>> I believe that the property binding is used to select a subsample of =
=
>> the datas after the dataset was retrieved from the datasource.
>> For efficiency purpose (since I'm working on big datas set), I want =
=
>> the full query (including the where clause) to be executed on the =
>> database server so that I can make use of the indexing. If I use the =
=
>> property binding for the where clause then most of the job will be =
>> achieved by the report engine and this is going to be too slow.
>> I would need something similar to the property binding where I can =
>> dynamically build the SQL query using javascript functions, before =
>> execution by the database server.
>> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt =
>> <philipp.tiedt@web.de> wrote:
>>
>>> serbenet wrote:
>>>> That's a shame then.
>>>> I can't use stored procedures or a scripted data source, and I fin=
d =
>>>> using parameters quite painfull:
>>>> You have to insert question marks in your query and then you need t=
o =
>>>> link each and single question mark to a report parameter. Which mea=
ns =
>>>> that:
>>>> - Every time you modify your query and add or remove a qustion mark=
=
>>>> then you have to do the whole linking all over again. If you have a=
=
>>>> few parameters it's ok, but if you have loads then it becomes a pai=
n.
>>>> - When you need to use multiple times the same paramteters you have=
=
>>>> to do the linking multiple times anyway even though it is the same =
=
>>>> parameter you use several times. For example:
>>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?=
=
>>>> AND field4 < ?;
>>>> All question marks must be linked to the same parameter, say =
>>>> params['report_param1'], but I will have to create 4 parameter =
>>>> linkings for that anyway.
>>>> - You can't just copy the text of your query to create a new one =
>>>> since you will have to redo the linking all over again.
>>>> I would love to be able to do something like this:
>>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND =
>>>> field2 < params['report_param1'];"
>>>> Nice and simple, directly in the SQL query editor, but unless I =
>>>> haven't still figured it out, this does not seem to be possible wit=
h =
>>>> BIRT.
>>>> So I thought I would do that instead:
>>>> "SET @param1:=3D?; SELECT * FROM table WHERE field1 < @param1 AND =
>>>> field2 < @param1;"
>>>> And link the first question mark only once to =
>>>> "params['report_param1']", but that doesn't work either.
>>>> A bit of user friendliness is needed I guess.
>>>> Any tips on this?
>>>> Thanks
>>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco =
>>>> <snjeza.peco@gmail.com> wrote:
>>>>
>>>>> BIRT can't run multiple queries. You can use either parameters, =
>>>>> stored procedures or a scripted data source.
>>>>>
>>>>> Snjeza
>>>>>
>>>>> serbenet wrote:
>>>>>> Hi all,
>>>>>> I am trying to run the following query with BIRT connected to a =
=
>>>>>> mysql database :
>>>>>> SET @value:=3D2;
>>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>>> In theory the query should work but for some reasons BIRT gives =
me =
>>>>>> an error:
>>>>>> A BIRT exception occurred.
>>>>>> Plug-in Provider:Eclipse.org
>>>>>> Plug-in Name:BIRT Data Engine
>>>>>> Plug-in ID:org.eclipse.birt.data
>>>>>> Version:2.2.1.r22x_v20070925
>>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>>> Error Message:Cannot get the result set metadata.
>>>>>> SQL statement does not return a ResultSet object.
>>>>>> SQL error #1: You have an error in your SQL syntax; check the =
>>>>>> manual that corresponds to your MySQL server version for the righ=
t =
>>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' =
at =
>>>>>> line 1
>>>>>> Any ideas on how to solve the issue?
>>>>>> It it possible to do what I am trying with BIRT?
>>>>>> Thanks.
>>>>>>
>>>>
>>> Could you try and use the property binding tab in the data set to =
>>> model your query? You could use the Expression builder to create a =
>>> query directly using your params.
>>>
>>> Its a bit of a workarround but might do. Specify your select query i=
n =
>>> the query tab without specifying the where clause. The copy that que=
ry =
>>> to the property binding tab query text field and use the expression =
=
>>> builder to add the where clause using your params. Maybe :-)
>>>
>>> Philipp
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Re: Multiple SQL queries with mysql [message #293634 is a reply to message #264936] |
Thu, 24 January 2008 14:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jasonweathersby.alltel.net
As a side note, property binding is a runtime feature and can be used to
modify the query before it runs, so it should not be selecting a
subsample but changing what data is retrieved. Filtering will on the
other hand will return a subsample.
Jason
serbenet wrote:
> I believe that the property binding is used to select a subsample of the
> datas after the dataset was retrieved from the datasource.
>
> For efficiency purpose (since I'm working on big datas set), I want the
> full query (including the where clause) to be executed on the database
> server so that I can make use of the indexing. If I use the property
> binding for the where clause then most of the job will be achieved by
> the report engine and this is going to be too slow.
>
> I would need something similar to the property binding where I can
> dynamically build the SQL query using javascript functions, before
> execution by the database server.
>
>
>
> On Wed, 23 Jan 2008 14:54:25 -0000, Philipp Tiedt <philipp.tiedt@web.de>
> wrote:
>
>> serbenet wrote:
>>> That's a shame then.
>>> I can't use stored procedures or a scripted data source, and I find
>>> using parameters quite painfull:
>>> You have to insert question marks in your query and then you need to
>>> link each and single question mark to a report parameter. Which means
>>> that:
>>> - Every time you modify your query and add or remove a qustion mark
>>> then you have to do the whole linking all over again. If you have a
>>> few parameters it's ok, but if you have loads then it becomes a pain.
>>> - When you need to use multiple times the same paramteters you have
>>> to do the linking multiple times anyway even though it is the same
>>> parameter you use several times. For example:
>>> SELECT * FROM table WHERE field1 < ? AND field2 < ? AND field3 < ?
>>> AND field4 < ?;
>>> All question marks must be linked to the same parameter, say
>>> params['report_param1'], but I will have to create 4 parameter
>>> linkings for that anyway.
>>> - You can't just copy the text of your query to create a new one
>>> since you will have to redo the linking all over again.
>>> I would love to be able to do something like this:
>>> "SELECT * FROM table WHERE field1 < params['report_param1'] AND
>>> field2 < params['report_param1'];"
>>> Nice and simple, directly in the SQL query editor, but unless I
>>> haven't still figured it out, this does not seem to be possible with
>>> BIRT.
>>> So I thought I would do that instead:
>>> "SET @param1:=?; SELECT * FROM table WHERE field1 < @param1 AND
>>> field2 < @param1;"
>>> And link the first question mark only once to
>>> "params['report_param1']", but that doesn't work either.
>>> A bit of user friendliness is needed I guess.
>>> Any tips on this?
>>> Thanks
>>> On Tue, 22 Jan 2008 23:37:16 -0000, Snjezana Peco
>>> <snjeza.peco@gmail.com> wrote:
>>>
>>>> BIRT can't run multiple queries. You can use either parameters,
>>>> stored procedures or a scripted data source.
>>>>
>>>> Snjeza
>>>>
>>>> serbenet wrote:
>>>>> Hi all,
>>>>> I am trying to run the following query with BIRT connected to a
>>>>> mysql database :
>>>>> SET @value:=2;
>>>>> SELECT * FROM table1 WHERE field1 < @value OR field2 < @value;
>>>>> In theory the query should work but for some reasons BIRT gives me
>>>>> an error:
>>>>> A BIRT exception occurred.
>>>>> Plug-in Provider:Eclipse.org
>>>>> Plug-in Name:BIRT Data Engine
>>>>> Plug-in ID:org.eclipse.birt.data
>>>>> Version:2.2.1.r22x_v20070925
>>>>> Error Code:odaconsumer.CannotGetResultSetMetaData
>>>>> Error Message:Cannot get the result set metadata.
>>>>> SQL statement does not return a ResultSet object.
>>>>> SQL error #1: You have an error in your SQL syntax; check the
>>>>> manual that corresponds to your MySQL server version for the right
>>>>> syntax to use near ';SELECT * FROM table1 WHERE field1 < @value' at
>>>>> line 1
>>>>> Any ideas on how to solve the issue?
>>>>> It it possible to do what I am trying with BIRT?
>>>>> Thanks.
>>>>>
>>>
>> Could you try and use the property binding tab in the data set to
>> model your query? You could use the Expression builder to create a
>> query directly using your params.
>>
>> Its a bit of a workarround but might do. Specify your select query in
>> the query tab without specifying the where clause. The copy that query
>> to the property binding tab query text field and use the expression
>> builder to add the where clause using your params. Maybe :-)
>>
>> Philipp
|
|
|
Goto Forum:
Current Time: Thu Aug 15 02:02:38 GMT 2024
Powered by FUDForum. Page generated in 0.38845 seconds
|