【问题标题】:Can we update html data of CLOB column by using SQL update?我们可以使用 SQL 更新来更新 CLOB 列的 html 数据吗?
【发布时间】:2021-10-25 11:17:44
【问题描述】:

我有需要在一个 clob 列中更新的 html 代码,如何将其转换为 sql 更新字符串? 我的第二个问题是如何插入 ® 和 & 存在于这个 html 代码中。

<html>
<head>
<style></style>
</head>
<body>
     <div>
      <div align="center" style="font-size:11pt;font-family:Calibri,sans-serif;">
            <b> card<sup><font size='3'>&reg;</font></sup>  Card  Notification</b>
            <br />
        </div>
        <hr />
        <p style="font-size:11pt;font-family:Calibri,sans-serif;">
            The online statement for your  card provided by {company name} and issued by Com is now available. Select the Account Maint. &amp; Statement tab to view your statement.
        </p>
        <p style="font-size:10pt;font-family:Calibri,sans-serif;">
            Equal Opportunity Lender.
        </p>
        <p style="font-size:10pt;font-family:Calibri,sans-serif;">
            This Card is issued  International Incorporated.
        </p>
      </div>
  </body>
</html>  

【问题讨论】:

    标签: html sql oracle


    【解决方案1】:

    一种选择是使用quotation。如果你使用sqlplus

    set define off
    update my table 
    set my_clob_column = q'[ <html>
    <head>
    <style></style>
    </head>
    <body>
         <div>
          <div align="center" style="font-size:11pt;font-family:Calibri,sans-serif;">
                <b> card<sup><font size='3'>&reg;</font></sup>  Card  Notification</b>
                <br />
            </div>
            <hr />
            <p style="font-size:11pt;font-family:Calibri,sans-serif;">
                The online statement for your  card provided by {company name} and issued by Com is now available. Select the Account Maint. &amp; Statement tab to view your statement.
            </p>
            <p style="font-size:10pt;font-family:Calibri,sans-serif;">
                Equal Opportunity Lender.
            </p>
            <p style="font-size:10pt;font-family:Calibri,sans-serif;">
                This Card is issued  International Incorporated.
            </p>
          </div>
      </body>
    </html>  ]' 
    where ........... 
    

    【讨论】:

    • 是的,这是获得解决方案的方法,只需要问一件事如何处理 & ® .您的解决方案正在运行,但只需要插入 & ®,那是在 html 代码中..你知道吗?
    • 如果您使用sqlplus,则使用set define off。我更新了帖子
    • @vim 那么这是一个蟾蜍问题。它必须有办法禁用替换变量或使用不同的字符。热门:support.quest.com/toad-for-oracle/kb/11560/…
    • @vim,你可以同样使用 Toad,但是将它作为脚本运行 (F5)
    • @vim,不客气。很高兴它有帮助。
    猜你喜欢
    • 2011-03-09
    • 1970-01-01
    • 1970-01-01
    • 2021-06-28
    • 2020-06-25
    • 2011-12-05
    • 2020-04-02
    • 1970-01-01
    • 2016-12-15
    相关资源
    最近更新 更多