With that simple peace of code you can retrive the full list of all “FK” Foreign Key of an Interbase or Firebird DB.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
SELECT rc.RDB$CONSTRAINT_NAME AS constraint_name, i.RDB$RELATION_NAME AS table_name, s.RDB$FIELD_NAME AS field_name, i.RDB$DESCRIPTION AS description, rc.RDB$DEFERRABLE AS is_deferrable, rc.RDB$INITIALLY_DEFERRED AS is_deferred, refc.RDB$UPDATE_RULE AS on_update, refc.RDB$DELETE_RULE AS on_delete, refc.RDB$MATCH_OPTION AS match_type, i2.RDB$RELATION_NAME AS references_table, s2.RDB$FIELD_NAME AS references_field, (s.RDB$FIELD_POSITION + 1) AS field_position FROM RDB$INDEX_SEGMENTS s LEFT JOIN RDB$INDICES i ON i.RDB$INDEX_NAME = s.RDB$INDEX_NAME LEFT JOIN RDB$RELATION_CONSTRAINTS rc ON rc.RDB$INDEX_NAME = s.RDB$INDEX_NAME LEFT JOIN RDB$REF_CONSTRAINTS refc ON rc.RDB$CONSTRAINT_NAME = refc.RDB$CONSTRAINT_NAME LEFT JOIN RDB$RELATION_CONSTRAINTS rc2 ON rc2.RDB$CONSTRAINT_NAME = refc.RDB$CONST_NAME_UQ LEFT JOIN RDB$INDICES i2 ON i2.RDB$INDEX_NAME = rc2.RDB$INDEX_NAME LEFT JOIN RDB$INDEX_SEGMENTS s2 ON i2.RDB$INDEX_NAME = s2.RDB$INDEX_NAME WHERE rc.RDB$CONSTRAINT_TYPE = 'FOREIGN KEY' ORDER BY s.RDB$FIELD_POSITION |
Con Delphi 10Seattle si possono creare in modo semplice delle bellissime applicazioni per Mac OSX e iOS, sarò di parte ma L’IDE di Delphi ora è veramente eccezzionale; Per prima cosa è necessario configurare l’ambiente di sviluppo, installando tutto il necessario come ben documentato da Embarcadero. Una volta che il vostro ambiente è ben funzionante,…
Leggi tutto
Hi, I think might be helpful, today for a customer i do the Haversine formulas for Firebird Sql as a stored procedure. This formula allow you to calculate the distance in meter between two WGS84 datum points(degree points of Earth). You can call the procedure like this:
1 |
SELECT * FROM HAVERSINE_GENERIC(1, 45,474081, 9,179348, 45,456091, 9) |
The result wil be aprox 14Km, the…
Leggi tutto
Remode Manager is a particular Web Server that lets you send commands to your Android device . All commands are interpreted by Remode simple http API . Among these controls are also APIs to read and write to a serial cable OTG . It is full done with Delphi 10Seattle except for an Extrnal jar…
Leggi tutto
TantiAuguridi un feliceNatale e di un 2016ricco di idee e progetti! TeamSynaptica