如何在 Oracle ApEx 中获取 PC 的本地 IP 地址

发布于 2024-08-20 18:31:40 字数 255 浏览 8 评论 0原文

我需要一种从 Oracle ApEx 中获取本地 IP 地址(ipconfig 命令信息中列出的 Windows 框)的方法。

这可能吗?我已经尝试了 owa_util.get_cgi_env('REMOTE_ADDR') 以及 sys_context( 'userenv', 'ip_address' )

只是似乎无法获取我的本地 PC IP Oracle ApEx 内的地址。

有什么想法吗?

I need a means of obtaining the local IP Address (Windows box listed in ipconfig command info) from within Oracle ApEx.

Is this possible? I have tried both owa_util.get_cgi_env('REMOTE_ADDR') as well as sys_context( 'userenv', 'ip_address' )

Just can't seem to get my local PC IP address within Oracle ApEx.

Any ideas?

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

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

发布评论

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

评论(3

猫七 2024-08-27 18:31:40

要获取Oracle客户端 IP地址,您必须使用您建议的地址::

select sys_context('userenv','ip_address') 
  from dual;

要获取Oracle服务器 IP地址,您可以使用:

select utl_inaddr.get_host_address(sys_context('userenv','server_host')) 
  from dual;

更新(来自评论) :如果您正在寻找应用程序服务器IP,而不是客户端或服务器。正确的?这是oracle无法获得的。这就像询问 oracle Web 服务器 IP。由于 Oracle Appex 是 100% PLSQL,因此您无法获取此信息。

To obtain the Oracle Client IP address you have to use the one you suggested::

select sys_context('userenv','ip_address') 
  from dual;

To obtain the Oracle Server IP address you can use:

select utl_inaddr.get_host_address(sys_context('userenv','server_host')) 
  from dual;

UPDATE (from comment): If you are looking for the application server IP, nor client nor server. Right? This cannot be obtained by oracle. This is like asking oracle the web server IP. As Oracle Appex is 100% PLSQL you cannot obtain this information.

旧梦荧光笔 2024-08-27 18:31:40

请记住,您的 PC 通过 ipconfig 告诉您的内容可能是本地网络 IP 地址。我的家庭 PC 被本地路由器分配的地址为 192.168.0.10,这与世界各地网络上的一万台其他 PC 相同。

也就是说,看看这个有任何帮助。

Bear in mind what your PC tells you, with ipconfig, may be a local network IP address. My home PC is assigned its address by the local router as 192.168.0.10 which would be same as ten thousand other PCs on networks around the world.

That said, see if this or this is any help.

故人如初 2024-08-27 18:31:40

如果您的应用程序部署在云上并且它将返回唯一的公共 IP 地址,则这将不起作用。

This will not work if your application is deployed on the cloud and it will return the only public IP address.

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