user1321466
user1321466

Reputation: 1959

ORA-01792: maximum number of columns in a table or view is 1000

I have java web app which use Oracle db. Web app use hibernate. I have 2 oracle instance - first one in server, second one in local virtual linux machine.

When I connect to local oracle instance at some point I get

ORA-01792: maximum number of columns in a table or view is 1000

exception. But when I connected to oracle (which is in server) don't get that exception. I am doing exactly same action and dump is same. So I think problem in oracle. maybe some configuration are different.

Can anybody tell me what can be differences between oracle servers which leads to this situation?

UPDATE. some parts from stacktrace

Caused by: org.hibernate.exception.SQLGrammarException: could not initialize a collection:
Caused by: java.sql.SQLSyntaxErrorException: ORA-01792: maximum number of columns in a table or view is 1000

Upvotes: 11

Views: 5593

Answers (2)

Joe
Joe

Reputation: 11

To avoid this Exception and to skip the check of this limit, you can set a _fix_control parameter, like:

ALTER SESSION SET "_fix_control"='17376322:OFF'

or

ALTER SYSTEM SET "_fix_control"='17376322:OFF'

(works with Oracle 12.1.0.2 Standard and Enterprise)

Upvotes: 1

Lalit Kumar B
Lalit Kumar B

Reputation: 49062

ORA-01792: maximum number of columns in a table or view is 1000

This limit is not only applicable to tables and views, but also on the temporary inline view and the temporary internal memory tables which Oracle creates while executing a subquery.

For example,

Oracle creates a temporary inline view based on the merge select, thus the same restriction is implemented on this temporary inline view. So, you need to make sure that the number of columns in a sub-select or subquery also doesn't exceed this limit of 1000.

Caused by: org.hibernate.exception.SQLGrammarException: could not initialize a collection:

The above error indicates that you are trying to create a collection which exceeds the limit of number of columns allowed, i.e. the total number of columns exceeds 1000.

Upvotes: 5

Related Questions