Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Named parameters in DataSet Query
Migrateduser
Hi,<br />
<br />
i am wondering what the status of subject is. My understanding is that even though DataSet parameters are required to have assigned non empty name, you can't afterwards refer them using name in actual Query. If true, that would be kind of inconsistent and weird.<br />
<br />
<strong class='bbc'>Traditional way of passing positional parameters that works, but is not very comfortable:</strong><br />
<pre class='_prettyXprint _lang-auto _linenums:0'>SELECT
myfield
FROM
mytable
WHERE
mykey = ?</pre>
<br />
<strong class='bbc'>Passing a parameter value via parameter name that fails.</strong><br />
<pre class='_prettyXprint _lang-auto _linenums:0'>SELECT
myfield
FROM
mytable
WHERE
mykey = :filterkey</pre>
<br />
<strong class='bbc'>Exception thrown:</strong><br />
<pre class='_prettyXprint _lang-auto _linenums:0'>org.eclipse.birt.data.engine.odaconsumer.OdaDataException: Cannot execute the statement.
org.eclipse.datatools.connectivity.oda.OdaException: Not all named parameters have been set: [filterkey] [SELECT...</pre>
<br />
I guess either the syntax used in my example is wrong or BIRT lacks named feature. The latter would be rather worrying as ORM provider I am using (Hibernate4) suggests use of named parameters and declares use of positional parameters as deprecated.<br />
<br />
Plus there would be obvious advantages of using named parameters instead of positional parameters in general, if available.<br />
<br />
Tested on BIRT 3.7.1.<br />
<br />
Anyone knows?<br />
<br />
Tomas
Find more posts tagged with
Comments
There are no comments yet