Heim  >  Artikel  >  Datenbank  >  在Oracle的SQLPLUS下显示CLOB中的内容

在Oracle的SQLPLUS下显示CLOB中的内容

WBOY
WBOYOriginal
2016-06-07 16:51:092042Durchsuche

create table a (content clob);select content from a;显示的内容为cotent中的部分内容和乱码,因为a是clob类型,不能直接从sel

create table a (content clob);

select content from a;

显示的内容为cotent中的部分内容和乱码,,因为a是clob类型,不能直接从select的结果中显示出来,需要借用Oracle系统的包dbms_lob来处理,才能正确显示出来content的内容。

select dbms_lob.substr(content) from a;

这样就能把content中的内容打印输出来了,不过你会发现输出的内容可能不全面。

那是因为sqlplus环境变量值限制了输出格式。可以通过set来设置来实现。

set heading off 不输出结果第一行的标题 (字段名称)

set long 40000  设置输出的字节数(比较大数)

再重新执行上面的SQL语句即可。

linux

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn