首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

long类型的字段拼接报错。该怎么解决

2014-01-08 
long类型的字段拼接报错。select max(column_expression)from (select t.index_owner,t.index_name,t.table

long类型的字段拼接报错。
select max(column_expression)
  from (select t.index_owner,
               t.index_name,
               t.table_owner,
               t.table_name,
               wm_concat(t.column_expression) over(partition by t.index_owner, t.index_name, t.table_owner, t.table_name order by column_position) as column_expression
          from sys.all_ind_expressions t)
 group by index_owner, index_name, table_owner, table_name

我要拼接column_expression字段,由于column_expression是long类型的。执行报:ORA-00997:非法自用long数据类型?请问大家如何解决?怎么改呢?
[解决办法]

引用:
Quote: 引用:

先转换成字符型试试
 我用to_lob和to_char都不能转呢?请问用什么转?

官方解释是因为long所存的字符长度很大,而CHAR有长度限制,为了避免长度溢出,你可以通过SUBSTR的方式截取规定的长度作为CHAR型

热点排行