Solved

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

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSum6 challenge 6 86
Program to display an alert on Windows Toolbar 2 77
Advice in Xamarin 21 78
draw a Christmas tree by using a nested loop? 26 61
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…

776 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