Tag Info

New answers tagged

1

The documentation says: Indices are not required for child key columns but they are almost always beneficial. Each time an application deletes a row from the parent table, it performs [some query]. If this SELECT returns any rows at all, then SQLite concludes that deleting the row from the parent table would violate the foreign key constraint and ...


1

Is it possible to have a foreign key that relates to information_schema No. information_schema contains views. You can't have a foreign key to a view. You can't set a foreign key to point at the underlying pg_catalog.pg_attribute table that defines columns, either, because foreign keys to system catalogs are not supported.


2

We can debug this. Create your FK with this code below, which includes the EXCEPTIONS clause. It will identify the specific rows in your child table options responsible for the errors. CREATE TABLE fk_exceptions ( row_id ROWID , owner VARCHAR2(30) , table_name VARCHAR2(30) , constraint VARCHAR2(30) ); ALTER TABLE options ADD ...


4

You shouldn't be able to drop a table that is the parent of another dependent table, even if it has no data. Because if you drop the parent, then you will never be able to insert any data in the child. You must first drop any child tables that reference enterprise_rma. Something doesn't match your description, though. You said you were having trouble ...


1

Unfortunately, I would have to go with rely on human intelligence and debugging to figure this out for yourself Here is why: Suppose you have the following table CREATE TABLE projects ( StaffID INT NOT NULL, ProjectName VARCHAR(20) NOT NULL, Allocation INT NOT NULL, PRIMARY KEY (StaffID, ProjectName) , FOREIGN KEY (StaffID) ...


0

Seems that foreign key options cannot be left undefined! CONSTRAINT `fk_Rent_Status_Code` FOREIGN KEY (`status_code`) REFERENCES `test`.`Rent_Status` (`rental_status_code`) ON DELETE NO ACTION ON UPDATE NO ACTION) must be changed to: CONSTRAINT `fk_Rent_Status_Code` FOREIGN KEY (`status_code`) REFERENCES `test`.`Rent_Status` ...


0

I've tried to do something similar some years ago and the SQL required defeated me as well! The approach I took was to use gawk to extract all the statements I wanted from the unload file and then run that file. The whole approach could potentially be run in a batch file using the SQLA command line utility dbunload.exe, then gawk, then isql to run the ...


-3

Using query 1 and 2 for drop your table 1) SET FOREIGN_KEY_CHECKS = 0; 2) DROP TABLE TableName; Here the TableName, which table you want to drop



Top 50 recent answers are included