ORA-01792:在sql中使用WITH时,表或视图中的最大列数为1000错误
我有一个问题:ORA-01792:在sql中使用WITH时,表或视图中的最大列数为1000错误,sql,oracle,Sql,Oracle,我有一个问题: WITH abc AS ( (SELECT SRC_DATA.*, (SELECT MAX(DECODE(OBJ.AUD_ACTION_FLAG,'D',OBJ.OUPDATE_COUNT,OBJ.NUPDATE_COUNT)) FROM SMARTTRIAL_ODR_LANDING.AUD_TRIAL_DESIGN OBJ WHERE OBJ.AUD_DATE_CHANGED BETWEEN TO_DATE('01-JAN-1900') AND
WITH abc AS
(
(SELECT SRC_DATA.*,
(SELECT MAX(DECODE(OBJ.AUD_ACTION_FLAG,'D',OBJ.OUPDATE_COUNT,OBJ.NUPDATE_COUNT))
FROM SMARTTRIAL_ODR_LANDING.AUD_TRIAL_DESIGN OBJ
WHERE OBJ.AUD_DATE_CHANGED BETWEEN TO_DATE('01-JAN-1900') AND (SRC_DATA.AUD_DATE_CHANGED)
AND DECODE(OBJ.AUD_ACTION_FLAG,'D',OBJ.OTRIAL_NO,OBJ.NTRIAL_NO)= DECODE(SRC_DATA.AUD_ACTION_FLAG,'D',SRC_DATA.OTRIAL_NO,SRC_DATA.NTRIAL_NO)
AND OBJ.AUD_ACTION_FLAG <> 'D'
) UPDATE_COUNT,
/***Multiple select statement like above with many other look up tables like AUD_TRIAL_DESIGN ****/
FROM SMARTTRIAL_ODR_LANDING.AUD_TRIAL SRC_DATA /***AUD_TRIAL is the base table***/
),
WITH def AS
(SELECT OBJ_DATA .*,
/***Similar statement as mentioned in above block and lookup table is AUD_OBJECTIVE***/
FROM SMARTTRIAL_ODR_LANDING.AUD_TRIAL_OBJECTIVE OBJ_DATA /***AUD_TRIAL_OBJECTIVE is the base table***/
)
对于我编写的查询的simliar结构,返回以下错误:
ORA-01792: maximum number of columns in a table or view is 1000
01792. 00000 - "maximum number of columns in a table or view is 1000"
*Cause: An attempt was made to create a table or view with more than 1000
columns, or to add more columns to a table or view which pushes
it over the maximum allowable limit of 1000. Note that unused
columns in the table are counted toward the 1000 column limit.
*Action: If the error is a result of a CREATE command, then reduce the
number of columns in the command and resubmit. If the error is
a result of an ALTER TABLE command, then there are two options:
1) If the table contained unused columns, remove them by executing
ALTER TABLE DROP UNUSED COLUMNS before adding new columns;
2) Reduce the number of columns in the command and resubmit.
有人能提出解决方案吗?我们遇到了类似的问题(这里是SR的摘录):
创建视图将生成ORA-01792表或视图中的最大列数为1000
我们有一个新的应用程序,它的视图包含35列。但是,在创建它时,它会错误地指出有超过1000列,这是错误的。我将附加视图定义
以下是甲骨文所说的(它确实解决了这个问题):
错误19893041:ORA-01792在更新到12.1.0.2时发生
作为副本关闭
Bug 19509982:默认情况下禁用用于提升ORA-1792的修复程序
解决方案:
SQL>alter system set“_fix_control”='17376322:OFF';
或
B.使用贴片19509982
(未发现与所附opatch冲突)
这可能与您遇到的问题相同。我们遇到了类似的问题(以下是SR的摘录):
创建视图将生成ORA-01792表或视图中的最大列数为1000
我们有一个新的应用程序,它的视图包含35列。但是,在创建它时,它会错误地指出有超过1000列,这是错误的。我将附加视图定义
以下是甲骨文所说的(它确实解决了这个问题):
错误19893041:ORA-01792在更新到12.1.0.2时发生
作为副本关闭
Bug 19509982:默认情况下禁用用于提升ORA-1792的修复程序
解决方案:
SQL>alter system set“_fix_control”='17376322:OFF';
或
B.使用贴片19509982
(未发现与所附opatch冲突)
这可能与您遇到的问题相同。此错误似乎不言自明:您的最终结果或查询中的某个中间结果超过1000列。请格式化代码,因为它很难阅读。您真的需要所有列吗?最好指定要选择的列,而不是使用
*
@Tim。。这是否意味着问题是由于表中的数据还是查询造成的?@HoneyBadger。。是的,我需要所有列此错误似乎不言自明:您的最终结果或查询中的某些中间结果超过1000列。请格式化代码,因为它很难阅读。您真的需要所有列吗?最好指定要选择的列,而不是使用*
@Tim。。这是否意味着问题是由于表中的数据还是查询造成的?@HoneyBadger。。是的,我需要所有的栏目
ORA-01792: maximum number of columns in a table or view is 1000
01792. 00000 - "maximum number of columns in a table or view is 1000"
*Cause: An attempt was made to create a table or view with more than 1000
columns, or to add more columns to a table or view which pushes
it over the maximum allowable limit of 1000. Note that unused
columns in the table are counted toward the 1000 column limit.
*Action: If the error is a result of a CREATE command, then reduce the
number of columns in the command and resubmit. If the error is
a result of an ALTER TABLE command, then there are two options:
1) If the table contained unused columns, remove them by executing
ALTER TABLE DROP UNUSED COLUMNS before adding new columns;
2) Reduce the number of columns in the command and resubmit.