iReport - parameterize schema name?
I have the following query :
SELECT
blah
FROM
"PUBLIC"."MYACTIVITY" MYACTIVITY
The problem is, the schema name is different for different environments. I tried making "PUBLIC"
a parameter like this:
SELECT
blah
FROM
"$P{schemaName}"."MYACTIVITY" MYACTIVITY
while setting schemeName
before I compile the report in the params, but no matter what I 开发者_如何学Cdo, or what the default value is set as, I get the following error:
Error:SQL problems:invalid schema name: ? in statement [SELECT blah FROM "?"."MYACTIVITY" MYACTIVITY
How do I properly parameterize the schema name for this report?
Try using $P!{schemaName}
. Note the exclamation mark. Use double quotes in the value:
SELECT
blah
FROM
$P!{schemaName}."MYACTIVITY" MYACTIVITY
And:
Let schemaName
= "PUBLIC"
(include the quotes).
The $P{}
substitution provides an interpreted value, whereas $P!{}
uses the literal value. You can use $P!{}
to change the query itself.
精彩评论