Solved

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

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

706 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now