Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check a FIELD exist in database???
Message
De
01/11/2000 14:20:06
 
 
À
01/11/2000 14:13:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00436819
Message ID:
00436828
Vues:
18
>Hi All ,
>I need to know a particular field (MyField) exist in the database . This field name can exist in any table/tables in the database . If I use INDBC() , I have to specify the table name along with the field name. I don’t know the table names . That’s my biggest problem.
> How can I do a global check to see whether ‘Myfield’ exist in database ??
>
>Please Help !!
>
>TIA
>
>- Jeana -
lcField = "myfieldname"
OPEN DATA mydata SHARE
SELECT d1.objectname AS table_name, d2.objectname AS field_name ;
  FROM DBC() d1 ;
  JOIN DBC() d2 ;
  ON d1.objectid = d2.parentid ;
  WHERE d1.objecttype = "Table" ;
  AND d2.objecttype = "Field" ;
  AND d2.objectname = lcField ;
  INTO CURSOR cutmp
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform