Skip to main content



      Home
Home » Archived » BIRT » Dynamically modify object owner at run time.
Dynamically modify object owner at run time. [message #150795] Tue, 04 April 2006 22:49
Eclipse UserFriend
Originally posted by: dougw.iplatinum.com.au

Does anyone know if it is possible to modify the object owner name in
the SQL querytext property using a parameter.

For instance we have a base query.

select * from table where id = ?

We would like to expand a variable using a parameter like so.

select * from param["owner"].table where id = ?

But it appears that the querytext property is parsed by an SQL
interpreter prior to execution which restricts the use of a javascript
variable.

We are already utilising datasource binding for the database connection
specifics, so the username is dynamic but it is not necessarily the
owner of the database object. And the report could be run for different
customers (owners) with same objects.

A work around is to use the beforeOpen method on the dataset to modify
the statement when an owner parameter is present.
i.e.
if (param["owner"])
{
this.queryText = "select * from "
+ param["owner"] +
".table where id = ?";
}

But. It means duplicating our SQL statements for each dataset and
complex statements with joins can get pretty messy just to handle this
single parameter.

It would be nice if we could define the object owner by way of an XML
property for the dataset, or have the dataset accept a javascript
variable directly.

Doug.
Previous Topic:Javascript Expression in Default Parameter
Next Topic:Submit birt request by html form fails
Goto Forum:
  


Current Time: Mon Nov 10 02:19:38 EST 2025

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

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

Back to the top