SQL syntax problem (offiste) / ORA-00972: identifier is too long

Dear experts,

I currently have no access to my Oracle db (offsite)...but I need the attached .sql to work.
==> Currently it returns a "ORA-00972: identifier is too long" error...which I can not fix from my "notepad"

Can you help me to solve this SQL syntax problem (or explain why a 14557 cars long SQL is "too long") ?

Best regards
Telephone-KOdeSyntaxe.sql
LVL 18
BigSchmuhAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

madvedsCommented:
Anyway use more compacts way:
translate(numtel, '0' || translate(numtel, '_1234567890', '_'), '0')

instead of with chr(N)


btw WHERE clause has restriction and it depends from version and other reasons... in my 10g version your query works.
0
Guy Hengel [angelIII / a3]Billing EngineerCommented:
the error does not mean the SQL is too long, but some identifier.
usually, it's about some quotes not being closed....

however, I cannot see the actual problem in the sql posted
0
BigSchmuhAuthor Commented:
@madveds: will your
   translate(numtel, '0' || translate(numtel, '_1234567890', '_'), '0')
remove all but numeric cars from numtel col ?

@angelIII: I know what "identifier too long" means...but I can find it as well...
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

slightwv (䄆 Netminder) Commented:
You can also use REGEXP_REPLACE to strip out non-numerics:

select regexp_replace('1D3$f#rf3','[^[:digit:]]*','') from dual
/
0
madvedsCommented:
BigSchmuh: yes it is. it's exactly remove all non-numeric characters
0
BigSchmuhAuthor Commented:
The below SQL did work well to transform my NUMTEL
SELECT SUBSTR(NUMTEL,1,20), VALIDITE
       , SUBSTR(
                  CASE WHEN SUBSTR(LTRIM(NUMTEL),1,1)='+' THEN '+' ELSE '' END
                  ||TRANSLATE( NUMTEL, '0123456789'||TRANSLATE( NUMTEL,'_0123456789','_'), '0123456789')
                  ||LTRIM(' '||TRANSLATE( NUMTEL, '_+0123456789.-       ','_'))
                  ,1,20) FROM g_telephone t
WHERE (VALIDITE<>'N' or VALIDITE is NULL)
 AND SUBSTR(TYPETEL,1,2)<>'EM'
 AND (NUMTEL is NULL
   or Length(NUMTEL)<10
   or Length(TRANSLATE( NUMTEL, '0123456789'||TRANSLATE( NUMTEL,'_0123456789','_'), '0123456789'))<10
      or SubStr( TRANSLATE( NUMTEL, '0123456789'||TRANSLATE( NUMTEL,'_0123456789','_'), '0123456789')
                  ,1,1) in('1','2','3','4','5','6','7','8','9')
      or SubStr( TRANSLATE( NUMTEL, '0123456789'||TRANSLATE( NUMTEL,'_0123456789','_'), '0123456789')
                  ,1,2) in('00')
      ) AND ROWNUM <= 10000;

Removing the column name looks like solving the "ORA-00972: identifier is too long" problem...even if I don't understand why adding a column name raised this error.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.