Subject | View not working properly.... |
---|---|
Author | Ranando King |
Post date | 2005-08-01T20:48:06Z |
I'm using the 1.5.2 Superserver on Linux
Here's the problem. I've got a query that looks like this:
SELECT L.*, T."Appraisal", T."Assessment", T."Area", T."UnitValue",
T."Millage", T."Year", T."Taxes", T."Adjustment", T."AdjustedFor",
T."Owner", T."Taxes"+T."Adjustment" AS "TotalTax"
FROM "Locations" L LEFT JOIN "ParcelTaxes" T ON L."Parcel No" = T."Parcel
No"
WHERE L."Sold" = 0;
Running that works great.
I created a view based on this query as such:
/* View: ParcelTaxHistory, Owner: SYSDBA */
CREATE VIEW "ParcelTaxHistory" ("Parcel No", "Location", "County",
"Description", "Image",
"Notes", "Sold", "Appraisal", "Assessment", "Area", "UnitValue", "Millage",
"Year", "Taxes",
"Adjustment", "AdjustedFor", "Owner", "TotalTax") AS
SELECT L.*, T."Appraisal", T."Assessment", T."Area", T."UnitValue",
T."Millage", T."Year", T."Taxes", T."Adjustment", T."AdjustedFor",
T."Owner", T."Taxes"+T."Adjustment" AS "TotalTax"
FROM "Locations" L LEFT JOIN "ParcelTaxes" T ON L."Parcel No" = T."Parcel
No"
WHERE L."Sold" = 0
;
Now if I do this:
Select *
From "ParcelTaxHistory";
I get null values for all the data that would've come from the "ParcelTaxes"
table. The plan that is being produced to query the view looks likee this:
PLAN JOIN (ParcelTaxHistory L NATURAL,ParcelTaxHistory T NATURAL)
But if I do this:
Select *
From "ParcelTaxHistory"
Plan JOIN ("ParcelTaxHistory" L NATURAL,"ParcelTaxHistory" T NATURAL);
I get this as an error:
Table ParcelTaxes is referenced in the plan but not the from list
Statement: Select *
From "ParcelTaxHistory"
Plan JOIN ("ParcelTaxHistory" L NATURAL,"ParcelTaxHistory" T NATURAL)
Can someone tell me what's going on here?
R.
Here's the problem. I've got a query that looks like this:
SELECT L.*, T."Appraisal", T."Assessment", T."Area", T."UnitValue",
T."Millage", T."Year", T."Taxes", T."Adjustment", T."AdjustedFor",
T."Owner", T."Taxes"+T."Adjustment" AS "TotalTax"
FROM "Locations" L LEFT JOIN "ParcelTaxes" T ON L."Parcel No" = T."Parcel
No"
WHERE L."Sold" = 0;
Running that works great.
I created a view based on this query as such:
/* View: ParcelTaxHistory, Owner: SYSDBA */
CREATE VIEW "ParcelTaxHistory" ("Parcel No", "Location", "County",
"Description", "Image",
"Notes", "Sold", "Appraisal", "Assessment", "Area", "UnitValue", "Millage",
"Year", "Taxes",
"Adjustment", "AdjustedFor", "Owner", "TotalTax") AS
SELECT L.*, T."Appraisal", T."Assessment", T."Area", T."UnitValue",
T."Millage", T."Year", T."Taxes", T."Adjustment", T."AdjustedFor",
T."Owner", T."Taxes"+T."Adjustment" AS "TotalTax"
FROM "Locations" L LEFT JOIN "ParcelTaxes" T ON L."Parcel No" = T."Parcel
No"
WHERE L."Sold" = 0
;
Now if I do this:
Select *
From "ParcelTaxHistory";
I get null values for all the data that would've come from the "ParcelTaxes"
table. The plan that is being produced to query the view looks likee this:
PLAN JOIN (ParcelTaxHistory L NATURAL,ParcelTaxHistory T NATURAL)
But if I do this:
Select *
From "ParcelTaxHistory"
Plan JOIN ("ParcelTaxHistory" L NATURAL,"ParcelTaxHistory" T NATURAL);
I get this as an error:
Table ParcelTaxes is referenced in the plan but not the from list
Statement: Select *
From "ParcelTaxHistory"
Plan JOIN ("ParcelTaxHistory" L NATURAL,"ParcelTaxHistory" T NATURAL)
Can someone tell me what's going on here?
R.