在 PL/SQL 过程中,将查询或引用游标包装在 HTML 表中
如果您使用 SQL*Plus 来使用
SQL> set markup html on;
SQL*Plus 窗口并获得一些可爱的结果,这似乎非常容易。我们有一个预言机工作,需要通宵运行,并将结果通过电子邮件发送给许多人。我想将 sql 语句包装在 HTML 表中以包含在该消息中。最好的方法是什么?
It seems really easy if you are using SQL*Plus to use
SQL> set markup html on;
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
来自发布于 DBA 网站 我已经接近了我正在寻找的答案。 Tom Kyte 有一篇很棒的博客文章,其功能正是我所希望的。简而言之,这就是我实现的内容:
我创建了一个将 sys_refcursor 作为变量的函数:
然后在 PL/SQL Developer 的测试窗口中测试它
这是我长期以来一直希望找到的东西。谢谢汤姆·凯特!
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:
I created a function that took a sys_refcursor as a variable:
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!
一种选择是使用超文本函数HTF:
打印(为了便于阅读而格式化):
One option is to use hypertext functions HTF:
Prints (formatted for readability):