如何在 Oracle ApEx 中的 Javascript 中访问 Oracle 数据库表列数据

发布于 2024-09-07 14:53:30 字数 110 浏览 5 评论 0 原文

我在数据库表中有一个列包含多个 url,我想知道将这些 url 从数据库表获取到 javascript 函数的最佳方法是什么。

如何解决这个问题的示例代码将不胜感激。

谢谢。

I have a column in a database table that contains several urls and I was wondering what is the best way to get these urls from the database table into a javascript function.

Example code of how to approach this would be much appreciated.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小嗷兮 2024-09-14 14:53:30

如果您可以通过 PL/SQL 代码将 URL 获取到页面项中,那么您可以从 Javascript 访问页面项值,如下所示:

url1 = $v('P1_URL1');
url2 = $v('P1_URL2');

例如,您可以有一个加载 PL/SQL 流程,如下所示:

select url1, url2
into   :p1_url1, :p1_url2
from   my_urls
where  ...;

将多个 URL 放入一个数组中您可以使用 PL/JSON 库 - 请参阅此示例。同样,这将是 PL/SQL 代码,用于将 JSON 数组放入页面项目中,然后您可以使用 v$() 从 Javascript 访问该页面项目。或者您可以按照此处所述使用AJAX 。

If you can get the URLs into page items via PL/SQL code then you can access the page item values from Javascript like this:

url1 = $v('P1_URL1');
url2 = $v('P1_URL2');

For example, you could have an on-load PL/SQL process like:

select url1, url2
into   :p1_url1, :p1_url2
from   my_urls
where  ...;

To put several URLs into an array you could use the PL/JSON library - see this example. Again, this would be PL/SQL code to put the JSON array into a page item which you can then access from Javascript using v$(). Or you could use AJAX as descrobed here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文