Subject | error: invalid database key. |
---|---|
Author | arkainrdk |
Post date | 2004-12-15T16:28:38Z |
The long & short:
This error happens on fb1.5.1 and ib6.
With a table defined as:
CREATE TABLE "Lease Ledger"
(
"LeaseLedgerKey" INTEGER NOT NULL,
"LeaseKey" INTEGER NOT NULL,
"PostDate" DATE NOT NULL,
"Type" VARCHAR(15) CHARACTER SET WIN1251 NOT NULL,
"Amount" "CURRENCY" Default 0 NOT NULL,
"Note" VARCHAR(128) CHARACTER SET WIN1251,
CONSTRAINT "PK_LeaseLedger" PRIMARY KEY ("LeaseLedgerKey")
);
ALTER TABLE "Lease Ledger" ADD CONSTRAINT "FK_LeaseLedger" FOREIGN
KEY ("LeaseKey") REFERENCES Leases ("LeaseKey") ON UPDATE CASCADE ON
DELETE CASCADE;
SET TERM ^ ;
and a view defined as:
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"
;
I get the "invalid database key" error every time I try to open the
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?
This error happens on fb1.5.1 and ib6.
With a table defined as:
CREATE TABLE "Lease Ledger"
(
"LeaseLedgerKey" INTEGER NOT NULL,
"LeaseKey" INTEGER NOT NULL,
"PostDate" DATE NOT NULL,
"Type" VARCHAR(15) CHARACTER SET WIN1251 NOT NULL,
"Amount" "CURRENCY" Default 0 NOT NULL,
"Note" VARCHAR(128) CHARACTER SET WIN1251,
CONSTRAINT "PK_LeaseLedger" PRIMARY KEY ("LeaseLedgerKey")
);
ALTER TABLE "Lease Ledger" ADD CONSTRAINT "FK_LeaseLedger" FOREIGN
KEY ("LeaseKey") REFERENCES Leases ("LeaseKey") ON UPDATE CASCADE ON
DELETE CASCADE;
SET TERM ^ ;
and a view defined as:
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"
;
I get the "invalid database key" error every time I try to open the
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?