Subject | Re: [ib-support] Error:Object is in use |
---|---|
Author | Paul Reeves |
Post date | 2001-02-22T11:23:58Z |
Gerhardus Geldenhuis wrote:
I ran the following script through ISQL :
drop table "BILLOFMATERIAL";
drop table "WORKSORDER";
commit;
CREATE TABLE "BILLOFMATERIAL"
(
"WONO" INTEGER NOT NULL,
"BMNO" INTEGER NOT NULL,
"QUANTITY" DOUBLE PRECISION,
CONSTRAINT "PK_BILLOFMATERIAL" PRIMARY KEY ("WONO", "BMNO")
);
CREATE TABLE "WORKSORDER"
(
"WONO" INTEGER NOT NULL,
"QUANTITY" DOUBLE PRECISION,
CONSTRAINT "PK_WORKSORDER" PRIMARY KEY ("WONO")
);
commit;
ALTER TABLE "BILLOFMATERIAL" ADD CONSTRAINT "FK_BILLOFMATERIAL"
FOREIGN KEY ("WONO") REFERENCES "WORKSORDER"
("WONO")
ON DELETE NO ACTION
ON UPDATE NO ACTION
;
commit;
I didn't have any problems.
Firebird / InterBase(r) needs exclusive access to make the metadata update, as
you have probably realised. My guess is that a second connection, or even just a
second transaction is open.
Try closing all connections to the database. Probably best to stop and restart
the server to make sure.
Then, connect to the database with ISQL and use INPUT myscript.sql (or whatever
is relevant for your context.)
Paul
--
Paul Reeves
http://www.ibphoenix.com
taking InterBase further
>Gerhardus,
> I have also tried to completely rename the tables and fields by adding
> a 1 to each name that still does not work. This leads me to
> conclude that somewhere there is a serious error in my database.
>
> For the time being I am going to recreate my database and pump
> the data over while it still works. I would still appreciate
> comments suggestions as to how to prevent/fix this.
>
I ran the following script through ISQL :
drop table "BILLOFMATERIAL";
drop table "WORKSORDER";
commit;
CREATE TABLE "BILLOFMATERIAL"
(
"WONO" INTEGER NOT NULL,
"BMNO" INTEGER NOT NULL,
"QUANTITY" DOUBLE PRECISION,
CONSTRAINT "PK_BILLOFMATERIAL" PRIMARY KEY ("WONO", "BMNO")
);
CREATE TABLE "WORKSORDER"
(
"WONO" INTEGER NOT NULL,
"QUANTITY" DOUBLE PRECISION,
CONSTRAINT "PK_WORKSORDER" PRIMARY KEY ("WONO")
);
commit;
ALTER TABLE "BILLOFMATERIAL" ADD CONSTRAINT "FK_BILLOFMATERIAL"
FOREIGN KEY ("WONO") REFERENCES "WORKSORDER"
("WONO")
ON DELETE NO ACTION
ON UPDATE NO ACTION
;
commit;
I didn't have any problems.
Firebird / InterBase(r) needs exclusive access to make the metadata update, as
you have probably realised. My guess is that a second connection, or even just a
second transaction is open.
Try closing all connections to the database. Probably best to stop and restart
the server to make sure.
Then, connect to the database with ISQL and use INPUT myscript.sql (or whatever
is relevant for your context.)
Paul
--
Paul Reeves
http://www.ibphoenix.com
taking InterBase further