简体   繁体   English

如何在pentaho BA Server中将参数名称作为数据库名称传递?

[英]how to pass parameter name as a databasename in pentaho BA Server?

I have scenario where i have one table in one database which consist all the database names,so in drop-down container i am displaying all this database name, now in another query i want to pass this database name as a parameter and want to retrieve data from the respected table. 我有一种情况,我在一个数据库中有一个包含所有数据库名称的表,因此在下拉容器中我正在显示所有此数据库名称,现在在另一个查询中我想将此数据库名称作为参数传递并想要检索来自相关表的数据。

Note : database structure is same for every client, but security reasons we have created different databases 注意:每个客户端的数据库结构都相同,但是出于安全考虑,我们创建了不同的数据库

Query one : using this i will get all the database names. 查询一:使用此命令,我将获取所有数据库名称。

SELECT tenant from kscommon.organization;

Query two : tenant will be parameter for next query 查询二:租户将成为下一个查询的参数

select location from ${tenant}.organization;

but i am getting error(Error processing component) 但是我遇到错误(错误处理组件)

SO can somebody guide me on this? 所以有人可以指导我吗?

I have tried this scenario but unable to achieve this but according to my experience you can use parameter in query conditions only. 我已经尝试过这种情况,但是无法实现,但是根据我的经验,您只能在查询条件中使用参数。 you will not able to use parameter name while creating database connection because if you are doing so that means you are trying to create multiple database connections during query level which i believe pentaho doesn't support at present. 您将无法在创建数据库连接时使用参数名称,因为如果这样做,则意味着您正在尝试在查询级别创建多个数据库连接,我相信pentaho目前不支持该连接。 In CDE you can explicitly create multiple connections and then try to use it when ever it required. 在CDE中,您可以显式创建多个连接,然后在需要时尝试使用它。

Still you can wait for other to answer this question. 您仍然可以等待其他人回答这个问题。

您可以通过Kettle(又名Pentaho数据集成)转换来实现

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 SQL Server 中,例如“使用 &lt;<DatabaseName> &gt;”,如何“使用&lt;<ServerName> &gt;&quot; 查询命令 - In SQL Server, like "use <<DatabaseName>>", how to "use <<ServerName>>" Query command 如何将数据库文件名通过一种形式传递给另一种形式 - How to I pass the database file name through one form to another 如何在SQL Server中更改实例名称 - How to change Instance name in SQL Server 如何使用Pentaho Kettle正确连接到Google Cloud SQL - How to connect properly to Google Cloud SQL using Pentaho Kettle PHP 通过构造函数传递一个对象作为参数 - PHP Pass an Object as a Parameter via the Constructor 如何仅使用服务器名称获取所有(远程)数据库的列表? - How to get a list of all (remote) database with the server name only? 将数据库连接作为参数传递给方法是否是一种好习惯? - Is it a good practice to pass db connection as parameter to methods? 我如何在 ssis 执行 sql 任务中动态传递数据库名称 - How can i pass database name dynamically in ssis execute sql task 从pentaho到mysql的连接 - Connection from pentaho to mysql 参数文件(.pf)中的数据库有多个逻辑名? - More that one logical-name for database in parameter file (.pf)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM