如何在 Oracle SQL*Plus HTML 报告中指定 HTML 文档类型?

发布于 2024-08-12 03:33:25 字数 641 浏览 1 评论 0原文

我正在使用以下查询生成 HTML 报告:

在表“WIDTH='100%' BORDER='1'”上设置标记 html
cellpadding='2px' cellspacing='0px'";

有没有办法包含文档类型声明,例如:


我已经搜索过,但看不到明显的方法。

更新:简单地添加带有文档类型的提示会产生以下结果(这会产生另一个验证错误!):

<代码>
    <头>
        
        ;
    
<正文>
    <预>
        

I'm producing an HTML report from a query using:

set markup html on table "WIDTH='100%' BORDER='1'
cellpadding='2px' cellspacing='0px'";

Is there a way of including a doctype declaration such as:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

I've searched but I can't see an obvious way of doing this.

UPDATE: Simply adding a prompt with a doctype produces the following (which produces another validation error!):

<html>
    <head>
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
        <style type="text/css">pre{background-color:white;font-family:"Courier New";font-size:16;color:black;}</style>
    </head>
<body>
    <pre>
        <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

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

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

发布评论

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

评论(2

陌路终见情 2024-08-19 03:33:25

我假设您正在从命令行执行类似这样的操作:

SQLPLUS -S -M "HTML ON" user/password@yourDB @yourQuery.sql > output.html

您可以做的是添加一些 shell 脚本来连接 DOCTYPE 和报告。假设文档类型被放入文件 DOCTYPE.TXT 中。您没有指定环境,但让我们尝试... Windows。那么我们就会有

SQLPLUS -S -M "HTML ON" user/password@yourDB @yourQuery.sql > intermediate.html
COPY DOCTYPE.TXT+intermediate.html output.html

I assume you're executing from the command line something like this:

SQLPLUS -S -M "HTML ON" user/password@yourDB @yourQuery.sql > output.html

What you can do is add some shell scripting to concatenate the DOCTYPE and the report. Let's assume the doctype is being put in a file DOCTYPE.TXT. You don't specify an environment, but let's try... Windows. Then we would have

SQLPLUS -S -M "HTML ON" user/password@yourDB @yourQuery.sql > intermediate.html
COPY DOCTYPE.TXT+intermediate.html output.html
怎会甘心 2024-08-19 03:33:25

添加 a ?

prompt <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
     "http://www.w3.org/TR/html4/loose.dtd">

为什么不简单地在脚本中的 set markup html on 语句之前

Why not simply put a

prompt <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
     "http://www.w3.org/TR/html4/loose.dtd">

in your script, BEFORE the set markup html on statement?

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