How to Access Oracle Database Table Column Data within Javascript in Oracle ApEx

主宰稳场 提交于 2019-12-13 05:16:15

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/3139678/how-to-access-oracle-database-table-column-data-within-javascript-in-oracle-apex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!