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

        <bdo id='DSYlj'></bdo><ul id='DSYlj'></ul>

      <small id='DSYlj'></small><noframes id='DSYlj'>

        <tfoot id='DSYlj'></tfoot>

        如何在 Oracle 中查询 CLOB 列

        How to query a CLOB column in Oracle(如何在 Oracle 中查询 CLOB 列)
        <i id='EAFrl'><tr id='EAFrl'><dt id='EAFrl'><q id='EAFrl'><span id='EAFrl'><b id='EAFrl'><form id='EAFrl'><ins id='EAFrl'></ins><ul id='EAFrl'></ul><sub id='EAFrl'></sub></form><legend id='EAFrl'></legend><bdo id='EAFrl'><pre id='EAFrl'><center id='EAFrl'></center></pre></bdo></b><th id='EAFrl'></th></span></q></dt></tr></i><div id='EAFrl'><tfoot id='EAFrl'></tfoot><dl id='EAFrl'><fieldset id='EAFrl'></fieldset></dl></div>

          <legend id='EAFrl'><style id='EAFrl'><dir id='EAFrl'><q id='EAFrl'></q></dir></style></legend>

          <tfoot id='EAFrl'></tfoot>
              <tbody id='EAFrl'></tbody>

                <bdo id='EAFrl'></bdo><ul id='EAFrl'></ul>

                <small id='EAFrl'></small><noframes id='EAFrl'>

                  本文介绍了如何在 Oracle 中查询 CLOB 列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试运行一个查询,其中有几列是 CLOB 数据类型.如果我像往常一样运行查询,所有这些字段都只有 (CLOB) 作为值.

                  我尝试使用 DBMS_LOB.substr(column) 但我收到错误

                  ORA-06502:PL/SQL:数字或值错误:字符串缓冲区太小

                  如何查询 CLOB 列?

                  解决方案

                  当获取 CLOB 列的子字符串并使用具有大小/缓冲区限制的查询工具时,有时您需要将 BUFFER 设置为更大的大小.例如,在使用 SQL Plus 时,使用 SET BUFFER 10000 将其设置为 10000,因为默认值为 4000.

                  运行 DBMS_LOB.substr 命令,您还可以指定要返回的字符数量和偏移量.因此,使用 DBMS_LOB.substr(column, 3000) 可能会将其限制为足够小的缓冲区数量.

                  请参阅 oracle 文档 有关 substr 命令的更多信息

                  <前>DBMS_LOB.SUBSTR (LOB CHARACTER SET ANY_CS 中的 lob_loc,整数数量:= 32767,整数中的偏移量 := 1)返回 VARCHAR2 字符集 lob_loc%CHARSET;

                  I'm trying to run a query that has a few columns that are a CLOB datatype. If i run the query like normal, all of those fields just have (CLOB) as the value.

                  I tried using DBMS_LOB.substr(column) and i get the error

                  ORA-06502: PL/SQL: numeric or value error: character string buffer too small
                  

                  How can i query the CLOB column?

                  解决方案

                  When getting the substring of a CLOB column and using a query tool that has size/buffer restrictions sometimes you would need to set the BUFFER to a larger size. For example while using SQL Plus use the SET BUFFER 10000 to set it to 10000 as the default is 4000.

                  Running the DBMS_LOB.substr command you can also specify the amount of characters you want to return and the offset from which. So using DBMS_LOB.substr(column, 3000) might restrict it to a small enough amount for the buffer.

                  See oracle documentation for more info on the substr command

                  
                      DBMS_LOB.SUBSTR (
                         lob_loc     IN    CLOB   CHARACTER SET ANY_CS,
                         amount      IN    INTEGER := 32767,
                         offset      IN    INTEGER := 1)
                        RETURN VARCHAR2 CHARACTER SET lob_loc%CHARSET;
                  
                  

                  这篇关于如何在 Oracle 中查询 CLOB 列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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='Rz6yZ'></bdo><ul id='Rz6yZ'></ul>
                      <legend id='Rz6yZ'><style id='Rz6yZ'><dir id='Rz6yZ'><q id='Rz6yZ'></q></dir></style></legend>

                      <small id='Rz6yZ'></small><noframes id='Rz6yZ'>

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