Solved

ORA-00 904 name COLUMN: invalid identifier

Posted on 2010-08-26
16
1,367 Views
Last Modified: 2013-12-07
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
0
Comment
Question by:enrique_aeo
  • 7
  • 4
  • 2
  • +3
16 Comments
 
LVL 14

Expert Comment

by:ajexpert
Comment Utility
I believe you have misspelled column name NOMBREDISTRITOJUDICIAL in  distritojudicial table
 
0
 

Author Comment

by:enrique_aeo
Comment Utility
this is not the problem, it happens that this column is within the query that is in brackets and I want to use outside
0
 
LVL 28

Expert Comment

by:Naveen Kumar
Comment Utility
give your complete query please.
0
 

Author Comment

by:enrique_aeo
Comment Utility
at this time I'm home, I happened within 10 hours
0
 
LVL 28

Expert Comment

by:Naveen Kumar
Comment Utility
ok. unless complete query is there, nothing much can be commented.
0
 

Expert Comment

by:JRCPrez
Comment Utility
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.
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
>> 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.

0
 
LVL 31

Expert Comment

by:awking00
Comment Utility
Try the attached.
query.txt
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:enrique_aeo
Comment Utility
I attached the main quey
mainQUERY.txt
0
 

Author Comment

by:enrique_aeo
Comment Utility
Please awking00: you can put your query to the main query
0
 

Author Comment

by:enrique_aeo
Comment Utility
HI awking00: i puit your code buy ia have this error: ORA-00936: missing expression
I attached all query
queryMODIFY.txt
0
 
LVL 31

Expert Comment

by:awking00
Comment Utility
See attached.
comments.txt
0
 

Author Comment

by:enrique_aeo
Comment Utility
i have the same error, view attached please
error01.jpg
error02.jpg
0
 
LVL 31

Expert Comment

by:awking00
Comment Utility
You need to include whatever table is aliased as t3 in the FROM clause.
0
 

Author Comment

by:enrique_aeo
Comment Utility
please, give me the code, i do not understand very well... sorry
0
 
LVL 31

Accepted Solution

by:
awking00 earned 500 total points
Comment Utility
In your where clause, you have a line that says "and r.login = t3.login" but, in your join (the from clause), you only reference tables with the aliases of r, u, cu, and dj. You need to include the table with the alias of t3.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now