Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

I don't understand this SQL0206N error - Can you help detect why and how to resolve it?

Posted on 2010-11-08
3
Medium Priority
?
896 Views
Last Modified: 2012-05-10
Hello all,  
I don't know how to determine what is wrong with my view definition and why I am getting the following [IBM][DB2/AIX64] SQL0206N  "RCATB_MRIS_OCHG.PERSON_IDN" is not valid in the context where it is used.  SQLSTATE=42703

CREATE VIEW RCAVW_MRIS_OCHG_CCS (PERSON_IDN, BVS_INST_CD, DPC_NBR,            
      DOC_FORMATTED_NAME, DATE_OF_SERVICE, CDX_CD1, CDX_CD2, CDX_CD3,          
      CDX_CD4, CHG_CREATE_DT) AS                                                
    SELECT RCATB_MRIS_OCHG.PERSON_IDN, RCATB_MRIS_OCHG.FPI_INST_CD,            
           RCATB_MRIS_OCHG.DOC_P_PROVIDER_ID,                                  
           RCATB_MRIS_OCHG.DOC_P_FORMTD_NAME,                                  
           RCATB_MRIS_OCHG.CHG_PERFORM_DT,                                      
           RCATB_MRIS_OCHG.CDX_DXS_CD01, RCATB_MRIS_OCHG.CDX_DXS_CD02,          
           RCATB_MRIS_OCHG.CDX_DXS_CD03, RCATB_MRIS_OCHG.CDX_DXS_CD04,          
           RCATB_MRIS_OCHG.CHG_CREATE_DT                                        
      FROM RCADB06D.RCATB_MRIS_OCHG

Table definition = RCATB_MRIS_OCHG.PERSON_IDN  CHAR(11) not null with default

What do you think is my problem ? Table is not loaded yet, could this be the trouble maker? Or should I explicitly state the default string?

Thanks
0
Comment
Question by:okonita1
[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
3 Comments
 
LVL 37

Accepted Solution

by:
momi_sabag earned 1000 total points
ID: 34089060
try
CREATE VIEW RCAVW_MRIS_OCHG_CCS (PERSON_IDN, BVS_INST_CD, DPC_NBR,            
      DOC_FORMATTED_NAME, DATE_OF_SERVICE, CDX_CD1, CDX_CD2, CDX_CD3,          
      CDX_CD4, CHG_CREATE_DT) AS                                                
    SELECT RCATB_MRIS_OCHG.PERSON_IDN, RCATB_MRIS_OCHG.FPI_INST_CD,            
           RCATB_MRIS_OCHG.DOC_P_PROVIDER_ID,                                  
           RCATB_MRIS_OCHG.DOC_P_FORMTD_NAME,                                  
           RCATB_MRIS_OCHG.CHG_PERFORM_DT,                                      
           RCATB_MRIS_OCHG.CDX_DXS_CD01, RCATB_MRIS_OCHG.CDX_DXS_CD02,          
           RCATB_MRIS_OCHG.CDX_DXS_CD03, RCATB_MRIS_OCHG.CDX_DXS_CD04,          
           RCATB_MRIS_OCHG.CHG_CREATE_DT                                        
      FROM RCADB06D.RCATB_MRIS_OCHG RCATB_MRIS_OCHG
0
 
LVL 8

Assisted Solution

by:mustaccio
mustaccio earned 1000 total points
ID: 34089167
The table name is "RCADB06D.RCATB_MRIS_OCHG", so "RCATB_MRIS_OCHG.PERSON_IDN" does not point to anything. You should either fully qualify the table name:

... AS SELECT RCADB06D.RCATB_MRIS_OCHG.PERSON_IDN...

or, as momi_sabaq has shown, provide a correlation name for the table:

... FROM  RCADB06D.RCATB_MRIS_OCHG RCATB_MRIS_OCHG
0
 

Author Closing Comment

by:okonita1
ID: 34102551
Thanks gentlemen. momi_sabaq code worked and
mustaccio explained why.

Again, thanks
0

Featured Post

Not sure which OpenStack Certification to get?

So you’ve realized you might want to get certified in OpenStack, but you’re not sure what the benefits might be or even which one you should take. You know there are several certification courses you can choose from, but how do you know which one is right for you?

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

704 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