Solved

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

Posted on 2010-11-08
3
893 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 250 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 250 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP/VB email question 4 72
AS400 QAOSDIAJRN / APYJRNCHG Processing 5 69
$_GET call between URL 3 70
Eclipse integration with Github giving error 3 54
A short article about problems I had with the new location API and permissions in Marshmallow
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

752 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