Solved

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

Posted on 2010-11-08
3
891 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
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

809 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