Hello,
I'm trying to use parameters for column and table name to SQL query over JNDY, which doesn't work, while parameters for values work fine.
I defined 3 simple parameter components with default values:
Then I defined an SQL query over JNDI, that looks like:
... which does not work, because parameter values of paramTable and paramColumn don't seem to apply properly, which causes:
Here are some query modifications, and their results really disappoint me:
Do I miss something?
I appreciate any help.
I'm trying to use parameters for column and table name to SQL query over JNDY, which doesn't work, while parameters for values work fine.
I defined 3 simple parameter components with default values:
Code:
paramTable = 'dummyTable'
paramColumn = 'dummyColumn'
paramValue = 'dummyValue'
Code:
select * from ${paramTable} where ${paramColumn} = ${paramValue};
Code:
Caused by: java.sql.SQLSyntaxErrorException: ORA-00903: invalid table name
Code:
select * from dummyTable where dummyColumn = ${paramValue};
-- works fine and delivers 1 row
select * from ${paramTable} where dummyColumn = 'dummyValue';
-- causes 'invalid table name'
select * from dummyTable where ${paramColumn} = 'dummyValue';
-- does not cause any errors, but if I console.log() the result set of the query,
it is empty (1 row is expected though)
I appreciate any help.