[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ORA-00 904 name COLUMN: invalid identifier

Posted on 2010-08-26
16
Medium Priority
?
1,461 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
  • 2
  • +3
16 Comments
 
LVL 14

Expert Comment

by:ajexpert
ID: 33537639
I believe you have misspelled column name NOMBREDISTRITOJUDICIAL in  distritojudicial table
 
0
 

Author Comment

by:enrique_aeo
ID: 33537654
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
ID: 33538321
give your complete query please.
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 

Author Comment

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

Expert Comment

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

Expert Comment

by:JRCPrez
ID: 33538657
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 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 33541157
>> 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 32

Expert Comment

by:awking00
ID: 33541185
Try the attached.
query.txt
0
 

Author Comment

by:enrique_aeo
ID: 33542290
I attached the main quey
mainQUERY.txt
0
 

Author Comment

by:enrique_aeo
ID: 33542356
Please awking00: you can put your query to the main query
0
 

Author Comment

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

Expert Comment

by:awking00
ID: 33542983
See attached.
comments.txt
0
 

Author Comment

by:enrique_aeo
ID: 33543128
i have the same error, view attached please
error01.jpg
error02.jpg
0
 
LVL 32

Expert Comment

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

Author Comment

by:enrique_aeo
ID: 33543262
please, give me the code, i do not understand very well... sorry
0
 
LVL 32

Accepted Solution

by:
awking00 earned 2000 total points
ID: 33549781
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
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 Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

656 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