Within a PL/SQL procedure, wrap a query or refcursor in HTML table(在 PL/SQL 过程中,在 HTML 表中包装查询或引用)
问题描述
如果您使用 SQL*Plus 来使用,那看起来真的很容易
It seems really easy if you are using SQL*Plus to use
并在 SQL*Plus 窗口中获得一些可爱的结果.我们有一个 oracle 工作,它会在一夜之间运行,并将结果通过电子邮件发送给许多人.我想将 sql 语句包装在 HTML 表中以包含在该消息中.这样做的最佳方法是什么?
and get some lovely results to the SQL*Plus window. we have an oracle job that runs overnight and sends an email of results to a number of people. I would like to wrap a sql statement in an HTML table to be in that message. What is the best way of doing that?
推荐答案
来自 在 DBA 站点 我接近了我正在寻找的答案.Tom Kyte 有一篇很棒的博文,其功能是正是我所希望的.简而言之,这是我实施的:
From posting over On the DBA site I got close to the answer that I was looking for. Tom Kyte has a great blog post with a function that does exactly what I was hoping for. In short here is what I implemented:
我创建了一个将 sys_refcursor 作为变量的函数:
I created a function that took a sys_refcursor as a variable:
然后在 PL/SQL Developer 的测试窗口中测试它
Then to test it in a Test window in PL/SQL Developer
这是我一直希望找到的东西.感谢汤姆·凯特!
This is something that I have been hoping to find for a long time. THANKS Tom Kyte!
这篇关于在 PL/SQL 过程中,在 HTML 表中包装查询或引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!