Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to retrieve the table's Unique Constraint from FireB
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
Firebird
Divers
Thread ID:
01266183
Message ID:
01266337
Vues:
10
Hi Jonathan

>Might this be what you're after?

Almost, see changes below
lcSQLTable = "MACCOUNTS"
*--Passed the name of a Firebird table, returns its primary key
*--Assumes giHandle contains previously-established connection handle
LOCAL lcSQL
TEXT TO lcSQL NOSHOW PRETEXT 15
     SELECT RDB$FIELD_NAME AS COLUMN_NAME
          FROM RDB$INDEX_SEGMENTS I
               INNER JOIN RDB$RELATION_CONSTRAINTS C
                    ON C.RDB$INDEX_NAME=I.RDB$INDEX_NAME
          WHERE RDB$CONSTRAINT_TYPE='UNIQUE' AND
               RDB$RELATION_NAME=?m.lcSQLTable
ENDTEXT
SQLEXEC(giHandle,lcSQL)
This will return the cursor containing all fields involved in the UNIQUE constraints. Thanks, without your help I would not know how to go about it.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform