Subject | Re: [firebird-support] error: invalid database key. |
---|---|
Author | Helen Borrie |
Post date | 2004-12-15T23:46:52Z |
At 04:28 PM 15/12/2004 +0000, you wrote:
two tables, aliased as L and LL respectively, yet there is no join in the
SELECT statement.
Create View "LeaseDue" ("LeaseKey", "Due")
As
Select L."LeaseKey", Sum(LL."Amount") As "Due"
From "Lease Ledger"
Where ("Type" Not In ('Payment', 'Credit')) And ("PostDate" < Cast
('now' As Date))
Group by L."LeaseKey"
;
Assuming there is no join, and both fields are derived from "Lease Ledger",
correct this to:
Create View "LeaseDue" ("LeaseKey", "Due")
As
Select "LeaseKey", Sum("Amount") /* As "Due" NO */
From"Lease Ledger"
Where ("Type" Not In ('Payment', 'Credit')) And ("PostDate" < Cast
('now' As Date))
Group by "LeaseKey"
;
./heLen
>I get the "invalid database key" error every time I try to open theThe view definition is defective. Your aliasiing implies a join between
>view, whether using an IBTable component in C++Builder or the data
>tab in the properties box from IBConsole. However, I can use:
>SELECT *
>FROM "LeaseDue";
>
>and retrieve the results very easily. What's wrong with this picture?
two tables, aliased as L and LL respectively, yet there is no join in the
SELECT statement.
Create View "LeaseDue" ("LeaseKey", "Due")
As
Select L."LeaseKey", Sum(LL."Amount") As "Due"
From "Lease Ledger"
Where ("Type" Not In ('Payment', 'Credit')) And ("PostDate" < Cast
('now' As Date))
Group by L."LeaseKey"
;
Assuming there is no join, and both fields are derived from "Lease Ledger",
correct this to:
Create View "LeaseDue" ("LeaseKey", "Due")
As
Select "LeaseKey", Sum("Amount") /* As "Due" NO */
From"Lease Ledger"
Where ("Type" Not In ('Payment', 'Credit')) And ("PostDate" < Cast
('now' As Date))
Group by "LeaseKey"
;
./heLen