My IT blog (and other stuff)

Find Bad Oracle Identifiers (ORA-00972)

| Comments

Today I had to struggle with some Oracle errors like

ORA-00972: identifier is too long

(Oracle identifiers can have a length up to 30 chars only.) Unfortunately, Oracle doesn’t tell you which identifier is too long. For me following Ruby snippet did the trick. Just copy your SQL into a file view.sql and run this one-liner:

1"view.sql").split(/[\.\(\s]/).each { |c| puts c if c.length > 30 }