Subject | help on view |
---|---|
Author | zifnabbe |
Post date | 2002-08-10T00:19:09Z |
Hi,
I've the following view, but it looks like the last join isn't
allowed. How can I make a view like this, but with code is allowed?:
CREATE VIEW VIEW_INVOICES(
INVOICE_ID,
PERSON_ID,
HEALTHCARE_ID,
INVOICE_DATETIME,
CONSULTATION_DATE,
CONSULTANT_ID,
NOMENCLATUUR_ID,
PERSON_HEALTHCAREID,
PAYED,
CONSULTANT_NAME,
PERSON_FIRSTNAME,
PERSON_SECONDNAME,
PERSON_LASTNAME,
PERSON_STREETNAME,
PERSON_STREETNUMBER,
PERSON_BUSNUMBER,
POSTCODE_ID,
CITY,
FEE)
AS
select INVOICES.*,
CONSULTANTS.CONSULTANT_NAME,
VIEW_PERSONS.PERSON_FIRSTNAME,
VIEW_PERSONS.PERSON_SECONDNAME,
VIEW_PERSONS.PERSON_LASTNAME,
VIEW_PERSONS.PERSON_STREETNAME,
VIEW_PERSONS.PERSON_STREETNUMBER,
VIEW_PERSONS.PERSON_BUSNUMBER,
VIEW_PERSONS.POSTCODE_ID,
VIEW_PERSONS.CITY,
FEES.FEE
from INVOICES
LEFT OUTER JOIN CONSULTANTS ON
CONSULTANTS.CONSULTANT_ID=INVOICES.CONSULTANT_ID
LEFT OUTER JOIN VIEW_PERSONS ON
VIEW_PERSONS.PERSON_ID=INVOICES.PERSON_ID
LEFT OUTER JOIN FEES ON
(FEES.NOMENCLATUUR_ID=INVOICES.NOMENCLATUUR_ID)
AND FEES.YEAR_ID = EXTRACT(YEAR from INVOICES.CONSULTATION_DATE);
I get the following error:
"This operation is not defined for system tables.
unsuccessful metadata update.
object VIEW_INVOICES is in use ."
Further, is it ok to make such a view? Are there better ways? Views
which perform better than this one?
Thanks in advance,
Tom
I've the following view, but it looks like the last join isn't
allowed. How can I make a view like this, but with code is allowed?:
CREATE VIEW VIEW_INVOICES(
INVOICE_ID,
PERSON_ID,
HEALTHCARE_ID,
INVOICE_DATETIME,
CONSULTATION_DATE,
CONSULTANT_ID,
NOMENCLATUUR_ID,
PERSON_HEALTHCAREID,
PAYED,
CONSULTANT_NAME,
PERSON_FIRSTNAME,
PERSON_SECONDNAME,
PERSON_LASTNAME,
PERSON_STREETNAME,
PERSON_STREETNUMBER,
PERSON_BUSNUMBER,
POSTCODE_ID,
CITY,
FEE)
AS
select INVOICES.*,
CONSULTANTS.CONSULTANT_NAME,
VIEW_PERSONS.PERSON_FIRSTNAME,
VIEW_PERSONS.PERSON_SECONDNAME,
VIEW_PERSONS.PERSON_LASTNAME,
VIEW_PERSONS.PERSON_STREETNAME,
VIEW_PERSONS.PERSON_STREETNUMBER,
VIEW_PERSONS.PERSON_BUSNUMBER,
VIEW_PERSONS.POSTCODE_ID,
VIEW_PERSONS.CITY,
FEES.FEE
from INVOICES
LEFT OUTER JOIN CONSULTANTS ON
CONSULTANTS.CONSULTANT_ID=INVOICES.CONSULTANT_ID
LEFT OUTER JOIN VIEW_PERSONS ON
VIEW_PERSONS.PERSON_ID=INVOICES.PERSON_ID
LEFT OUTER JOIN FEES ON
(FEES.NOMENCLATUUR_ID=INVOICES.NOMENCLATUUR_ID)
AND FEES.YEAR_ID = EXTRACT(YEAR from INVOICES.CONSULTATION_DATE);
I get the following error:
"This operation is not defined for system tables.
unsuccessful metadata update.
object VIEW_INVOICES is in use ."
Further, is it ok to make such a view? Are there better ways? Views
which perform better than this one?
Thanks in advance,
Tom