<small id='38jib'></small><noframes id='38jib'>

<i id='38jib'><tr id='38jib'><dt id='38jib'><q id='38jib'><span id='38jib'><b id='38jib'><form id='38jib'><ins id='38jib'></ins><ul id='38jib'></ul><sub id='38jib'></sub></form><legend id='38jib'></legend><bdo id='38jib'><pre id='38jib'><center id='38jib'></center></pre></bdo></b><th id='38jib'></th></span></q></dt></tr></i><div id='38jib'><tfoot id='38jib'></tfoot><dl id='38jib'><fieldset id='38jib'></fieldset></dl></div>

    • <bdo id='38jib'></bdo><ul id='38jib'></ul>
  1. <legend id='38jib'><style id='38jib'><dir id='38jib'><q id='38jib'></q></dir></style></legend>

    1. <tfoot id='38jib'></tfoot>

    2. 如何从 Oracle SQL 中的 BLOB 获取文本内容

      How do I get textual contents from BLOB in Oracle SQL(如何从 Oracle SQL 中的 BLOB 获取文本内容)

    3. <tfoot id='2YqqT'></tfoot>

          <tbody id='2YqqT'></tbody>

            • <bdo id='2YqqT'></bdo><ul id='2YqqT'></ul>

                <legend id='2YqqT'><style id='2YqqT'><dir id='2YqqT'><q id='2YqqT'></q></dir></style></legend>
                <i id='2YqqT'><tr id='2YqqT'><dt id='2YqqT'><q id='2YqqT'><span id='2YqqT'><b id='2YqqT'><form id='2YqqT'><ins id='2YqqT'></ins><ul id='2YqqT'></ul><sub id='2YqqT'></sub></form><legend id='2YqqT'></legend><bdo id='2YqqT'><pre id='2YqqT'><center id='2YqqT'></center></pre></bdo></b><th id='2YqqT'></th></span></q></dt></tr></i><div id='2YqqT'><tfoot id='2YqqT'></tfoot><dl id='2YqqT'><fieldset id='2YqqT'></fieldset></dl></div>

                <small id='2YqqT'></small><noframes id='2YqqT'>

              1. 本文介绍了如何从 Oracle SQL 中的 BLOB 获取文本内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我试图从 SQL 控制台查看 Oracle BLOB 中的内容.

                我知道它包含的文本体量有点大,我只想查看文本,但以下查询仅表明该字段中有一个 BLOB:

                select BLOB_FIELD from TABLE_WITH_BLOB where ID = '';

                我得到的结果并不完全符合我的预期:

                <前>BLOB_FIELD-----------------------oracle.sql.BLOB@1c4ada9

                那么我可以做什么样的魔法咒语才能将 BLOB 变成它的文本表示?

                PS:我只是想从 SQL 控制台(Eclipse Data Tools)查看 BLOB 的内容,而不是在代码中使用它.

                解决方案

                首先,您可能希望将文本存储在 CLOB/NCLOB 列中,而不是专为二进制数据设计的 BLOB(您的查询将使用 CLOB,顺便说一句).

                以下查询将让您看到 blob 中文本的前 32767 个字符(最多),前提是所有字符集都兼容(存储在 BLOB 中的文本的原始 CS,用于 VARCHAR2 的数据库的 CS) :

                select utl_raw.cast_to_varchar2(dbms_lob.substr(BLOB_FIELD)) from TABLE_WITH_BLOB where ID = '';

                I am trying to see from an SQL console what is inside an Oracle BLOB.

                I know it contains a somewhat large body of text and I want to just see the text, but the following query only indicates that there is a BLOB in that field:

                select BLOB_FIELD from TABLE_WITH_BLOB where ID = '<row id>';
                

                the result I'm getting is not quite what I expected:

                    BLOB_FIELD
                    -----------------------
                    oracle.sql.BLOB@1c4ada9
                

                So what kind of magic incantations can I do to turn the BLOB into it's textual representation?

                PS: I am just trying to look at the content of the BLOB from an SQL console (Eclipse Data Tools), not use it in code.

                解决方案

                First of all, you may want to store text in CLOB/NCLOB columns instead of BLOB, which is designed for binary data (your query would work with a CLOB, by the way).

                The following query will let you see the first 32767 characters (at most) of the text inside the blob, provided all the character sets are compatible (original CS of the text stored in the BLOB, CS of the database used for VARCHAR2) :

                select utl_raw.cast_to_varchar2(dbms_lob.substr(BLOB_FIELD)) from TABLE_WITH_BLOB where ID = '<row id>';
                

                这篇关于如何从 Oracle SQL 中的 BLOB 获取文本内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                SQL query to group by day(按天分组的 SQL 查询)
                What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                Include missing months in Group By query(在 Group By 查询中包含缺失的月份)

                  <bdo id='i3CVl'></bdo><ul id='i3CVl'></ul>
                    1. <legend id='i3CVl'><style id='i3CVl'><dir id='i3CVl'><q id='i3CVl'></q></dir></style></legend>

                          <i id='i3CVl'><tr id='i3CVl'><dt id='i3CVl'><q id='i3CVl'><span id='i3CVl'><b id='i3CVl'><form id='i3CVl'><ins id='i3CVl'></ins><ul id='i3CVl'></ul><sub id='i3CVl'></sub></form><legend id='i3CVl'></legend><bdo id='i3CVl'><pre id='i3CVl'><center id='i3CVl'></center></pre></bdo></b><th id='i3CVl'></th></span></q></dt></tr></i><div id='i3CVl'><tfoot id='i3CVl'></tfoot><dl id='i3CVl'><fieldset id='i3CVl'></fieldset></dl></div>
                          <tfoot id='i3CVl'></tfoot>
                        • <small id='i3CVl'></small><noframes id='i3CVl'>

                            <tbody id='i3CVl'></tbody>