开发者

How to use different Oracle schemas in Crystal Reports?

开发者 https://www.devze.com 2023-01-24 00:02 出处:网络
Is it possible to use different Oracle schemas in Crystal Reports and change between them at runtime?

Is it possible to use different Oracle schemas in Crystal Reports and change between them at runtime?

I have a report that uses three tables. The report was created using one database user schema. In the other schemas that I have to use, the names of the tables are the same. I need to change between them at runtime. Different users get different data depending on the schema they connect to. I set the servername, the userid, the password and then integratedsecurity to false. If I change/set the DatabaseName it doesn't work. I use Crystal Reports 2008.

Could you be kind and help me with this?

Thank you ve开发者_开发技巧ry much !


Don't use Crystal's database expert - instead, write SQL queries that do not specify schema. That way, the query will access the tables in the local schema when logged on to it.

eg:

Existing query:

select field1, field2, ...
from user_schema1.datatable

- will select data from user_schema1.datatable, regardless of which schema is logged on.

Amended query:

select field1, field2, ...
from datatable

- will select data from datatable in user_schema1 when logged on to user_schema1, from user_schema2 when logged on to user_schema2, etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消