IReport - parameterize schema name?

I have the following query:

SELECT
     blah
FROM
     "PUBLIC"."MYACTIVITY" MYACTIVITY

The problem is that the schema name is different for different environments. I tried to make a "PUBLIC"parameter similar to this:

SELECT
     blah
FROM
     "$P{schemaName}"."MYACTIVITY" MYACTIVITY

when configuring schemeName, before compiling the report in the parameters, but no matter what I do or what is set by default, I get the following error:

Error:SQL problems:invalid schema name: ? in statement [SELECT blah FROM "?"."MYACTIVITY" MYACTIVITY

How to correctly parameterize the schema name for this report?

+5
source share
1 answer

Try to use $P!{schemaName}. Pay attention to the exclamation mark. Use double quotes in the value:

SELECT
     blah
FROM
     $P!{schemaName}."MYACTIVITY" MYACTIVITY

and

Let schemaName= "PUBLIC"(including quotation marks).

$P{} , $P!{} . $P!{} .

+3

All Articles