I'm wokring on building custom hierarchy for accounts. I used this lib to build queries to get descendants.

I have a field named AlternatParent__c (changed name, same length though). This is the field that builds the hierarchy. But when I run descendants search I get the following error.

System.UnexpectedException: common.exception.SfdcSqlException: ORA-00972: identifier is too long

The error only appears in Sandbox. In scratch org it works perfectly.

1 Answer 1


As it is stated here:

An ORA-00972 means you are using a database column or object identifier name that is too long

In my case the problem was that the query that I try to execute has the following relation field:


So I changed the depth level of my query to one less:


And it worked perfectly. Beware of long queries and may the Force.com be with you!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.