简体   繁体   English

Oracle Apex:是否可以在运行时更改默认架构?

[英]Oracle Apex: Is it possible to change the default schema at runtime?

We have an Apex application (version 20.1) and our users must be able to change the database schema at runtime via button click (preferably without logging in again).我们有一个 Apex 应用程序(版本 20.1),我们的用户必须能够在运行时通过单击按钮更改数据库架构(最好无需再次登录)。 Currently we are solving this by installing our application multiple times, once per schema.目前我们正在通过多次安装我们的应用程序来解决这个问题,每个模式一次。

We recently discovered the function apex_export.get_application .我们最近发现了 function apex_export.get_application We intend to use this function to bring our frontend under version control (finally.).我们打算使用这个 function 将我们的前端置于版本控制之下(最终)。 We would like to deploy our application directly from the exported files, Having a single application.我们想直接从导出的文件部署我们的应用程序,拥有一个应用程序。 we would not have to mess with the internal component ids from the exported files.我们不必弄乱导出文件中的内部组件 ID。

Is it possible to install the application once and change the default schema via Pl/SQL code?是否可以一次安装应用程序并通过 Pl/SQL 代码更改默认模式? Thank you!谢谢!

I don't think this can be done, but perhaps the following is a reasonable compromise我不认为这是可以做到的,但也许以下是一个合理的妥协

  1. add all the schemas you need to support to the workspace schema list将您需要支持的所有模式添加到工作区模式列表
  2. Any SQL (and I do mean any ) in your app would be prefixed with an application item, eg您的应用程序中的任何 SQL (我的意思是any )都将以应用程序项为前缀,例如

Before: select * from my_table After: select * from &my_schema..my_table之前:select * 来自 my_table 之后:select * 来自 &my_schema..my_table

  1. At login time (or when a user selects it) you modify the MY_SCHEMA application item在登录时(或当用户选择它时)您修改 MY_SCHEMA 应用程序项

(I've not tried this...so test/tread carefully) (我没有尝试过......所以请仔细测试/踩踏)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM