Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check a FIELD exist in database???
Message
From
01/11/2000 14:20:06
 
 
To
01/11/2000 14:13:38
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00436819
Message ID:
00436828
Views:
17
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform