enrique_aeo
asked on
ORA-00 904 name COLUMN: invalid identifier
Hi experts, i have this subquery
...
CASE
(SELECT DISTINCT (cu.descripcioncargo)
FROM inscripcion.reportemovimie nto r,
inscripcion.usuario u,
inscripcion.cargousuario cu,
inscripcion.distritojudici al 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
...
CASE
(SELECT DISTINCT (cu.descripcioncargo)
FROM inscripcion.reportemovimie
inscripcion.usuario u,
inscripcion.cargousuario cu,
inscripcion.distritojudici
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
I believe you have misspelled column name NOMBREDISTRITOJUDICIAL in distritojudicial table
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
give your complete query please.
ASKER
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.
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
query.txt
ASKER
I attached the main quey
mainQUERY.txt
mainQUERY.txt
ASKER
Please awking00: you can put your query to the main query
ASKER
HI awking00: i puit your code buy ia have this error: ORA-00936: missing expression
I attached all query
queryMODIFY.txt
I attached all query
queryMODIFY.txt
See attached.
comments.txt
comments.txt
ASKER
You need to include whatever table is aliased as t3 in the FROM clause.
ASKER
please, give me the code, i do not understand very well... sorry
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.