如何从 PL/SQL、Oracle Forms 调用 Perl 模块?

发布于 2024-11-18 19:12:16 字数 306 浏览 3 评论 0原文

我们想要做的是将数据从 Oracle Forms 导出到 XLS 文件(服务器端)。我们发现 Perl 对此有出色的 SpreadSheet::WriteExcel 和 SpreadSheet::WriteExcelXML 模块。 最好的事情是我们不需要安装任何其他应用程序(如 MS Excel、OpenOffice)。

一种方法是连接到我的数据库,执行查询并生成 XLS 文件 - 一切都来自 Perl 脚本。 但是,因为将所有代码维护在一个地方会更容易,所以有没有一种方法可以从 Oracle Forms 的 PL/SQL 代码调用这些 Perl 模块?

谢谢

What we would like to do is to export data from Oracle Forms into XLS file (server-side). We found out that Perl has superb SpreadSheet::WriteExcel and SpreadSheet::WriteExcelXML modules for this.
The best thing with this is we don't have to have any other apps (like MS Excel, OpenOffice) installed.

One way is to connect to my database, execute query and generate XLS file - everything from a Perl script.
But, because it would be easier to maintain all the code in one place, is there a way to call these Perl modules from a PL/SQL code from the Oracle Forms??

Thanks

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

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

发布评论

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

评论(3

南渊 2024-11-25 19:12:16

从 90 年代的 4.5 开始我就不知道 oracle 形式了,我想从那时起它已经发生了一些变化。

如果您的 PL/SQL 在服务器端运行,那么您可以查看 extproc_perl
http://www.smashing.org/extproc_perl/userguide.html
但我认为这可能有点麻烦 - 我只编写过 C++ exptprocs,从未编写过 perl。预计会出现一些动态链接初期问题。而且代码并不直接位于 PL/SQL 中。您必须围绕 perl 编写一个 PL/SQL 包装器(实际上是围绕调用 perl 的 C,但您不必担心 C)。

更简单的解决方案(我认为您已经提到过)是让表单调用 perl CGI 脚本,该脚本自己连接到数据库,然后输出 excel 作为结果。

I don't know oracle forms since 4.5 back in the 90s, I assume its moved on a bit since then.

If you PL/SQL is running server side, then you could look at extproc_perl
http://www.smashing.org/extproc_perl/userguide.html
But I reckon that could be a bit of hassle - I have only written C++ exptprocs, never perl. Expect some dynaimic linking teething problems. Also the code is not directly in the PL/SQL. You have to write a PL/SQL wrapper around the perl (actually around the C which invokes the perl - but you shouldn't have to worry about the C).

The simpler solution (which I think you have already alluded to) is to have the form invoke a perl CGI script which makes its own connection to the DB, and then outputs the excel as the result.

半世晨晓 2024-11-25 19:12:16

从 PL/SQL 或 Oracle 表单运行外部程序非常困难:

http://www.orafaq.com/wiki/PL/SQL_FAQ#Can_one_execute_an_operating_system_command_from_PL.2FSQL.3F

正如@Sodved提到使用Perl CGI脚本创建文件并将其下载给用户是可能是最简单的方法。您将需要使用表单 WEB.SHOW_DOCUMENT 函数。

Running external programs from PL/SQL or Oracle forms is very difficult:

http://www.orafaq.com/wiki/PL/SQL_FAQ#Can_one_execute_an_operating_system_command_from_PL.2FSQL.3F

As @Sodved mentions using a Perl CGI script to create and download the file to the user is probably the easiest way. You will want to use the forms WEB.SHOW_DOCUMENT function.

青春有你 2024-11-25 19:12:16

一种解决方案是创建一个作业队列表,并让 Oracle Forms 代码将记录插入到该表中以完成需要完成的任务。然后有一个守护进程来监视表中的新记录并执行处理来处理请求。

您还可以使用 dbms_alertdbms_pipe 包将消息与表一起发送到守护程序,或者不使用表。

One solution is to create a job queue table and have your Oracle Forms code insert records into that table for the tasks they need done. Then have a daemon process that watches the table for new records and executes processed to handle the requests.

You can also use the packages dbms_alert or dbms_pipe to send messages to the daemon along with or instead of using a table.

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