Google
 

Rabu, 17 Oktober 2007

Firebird System Table (Part V)

In this part V, I would like to share the system table that list the constraint of the database. I often use this view to find which constraint that make an error on my program (the table that the constraint belongs on, or just the index name that cause the error).

As we know in Delphi if our query make an error then if you trap the exception, it will show the name of the constraint error (if the error caused by constraint error).

CREATE VIEW "vSYS_FindConstraint"(
"consTipe",
"tableName",
"consName",
"indexName")
AS
select c.rdb$constraint_type, c.rdb$relation_name, c.rdb$constraint_name, c.rdb$index_name
from rdb$relation_constraints c

Tidak ada komentar: