Link to home
Start Free TrialLog in
Avatar of enrique_aeo
enrique_aeo

asked on

ORA-00 904 name COLUMN: invalid identifier

Hi experts, i have this subquery
...
CASE      
     (SELECT DISTINCT (cu.descripcioncargo)
      FROM inscripcion.reportemovimiento r,
                inscripcion.usuario u,
                inscripcion.cargousuario cu,
                inscripcion.distritojudicial dj
      WHERE r.obs IS NULL
               AND r.login = u.login
               AND cu.codcargo = u.codcargo
               AND dj.coddistritojudicial = u.coddistritojudicial
               AND r.login = t3.login)
 WHEN 'MP' THEN 'Ministerio Público del Distrito ' || dj.NOMBREDISTRITOJUDICIAL
 WHEN 'PJ' THEN 'Corte Superior de Justicia ' || dj.NOMBREDISTRITOJUDICIAL
 END
...

what can i do for use dj.NOMBREDISTRITOJUDICIAL
In this moment i have this error
ORA-00 904 "DJ". "NOMBREDISTRITOJUDICIAL": invalid identifier
Avatar of ajexpert
ajexpert
Flag of United States of America image

I believe you have misspelled column name NOMBREDISTRITOJUDICIAL in  distritojudicial table
 
Avatar of enrique_aeo
enrique_aeo

ASKER

this is not the problem, it happens that this column is within the query that is in brackets and I want to use outside
Avatar of Naveen Kumar
give your complete query please.
at this time I'm home, I happened within 10 hours
ok. unless complete query is there, nothing much can be commented.
You are using the table alias "dj" in the subquery (the query enclosed in parentheses), but then you try to access the same table alias outside of that subquery - that appears to be the problem. But without seeing the entire query, not sure.
>> it happens that this column is within the query that is in brackets and I want to use outside

As JRCPrez suggests and based on your own statement, you cannot do this.  It's a scope issue.  The column only exists within the scope of the subquery.  You cannot reference it outside that scope.

Try the attached.
query.txt
I attached the main quey
mainQUERY.txt
Please awking00: you can put your query to the main query
HI awking00: i puit your code buy ia have this error: ORA-00936: missing expression
I attached all query
queryMODIFY.txt
See attached.
comments.txt
i have the same error, view attached please
error01.jpg
error02.jpg
You need to include whatever table is aliased as t3 in the FROM clause.
please, give me the code, i do not understand very well... sorry
ASKER CERTIFIED SOLUTION
Avatar of awking00
awking00
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial