Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Process Database Tables as Collection Items?
Message
De
28/07/2015 02:56:41
 
 
À
27/07/2015 17:09:39
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 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01622575
Message ID:
01622593
Vues:
64
>I'd like to process all the tables of a VFP database, looking for column names that contain certain strings. Does an open database expose any collection properties/attributes? It would be nice to be able to do something like this:
>
>OPEN DATABASE MyDBC
>
>FOR EACH {table} IN MyDBC
>  ...
>
Hi All,

There is no object for this, only various functions to get parcial information, but you can do it using simple SQL, as this:
USE c:\path\database.DBC SHARED AGAIN IN 0 ALIAS 'mydbc' NOUPDATE
SELECT ObjectName FROM mydbc ;
	WHERE ObjectType = 'Table' and ObjectId in ;
	(SELECT parentId FROM mydbc WHERE ObjectType = 'Field' AND ObjectName like '%your-search%')
Edit: You just need to change the "database.dbc" name and "%your-search%", the result is the list of tables that have thie fieldname coincidence.


Best Regards.-
Fernando D. Bozzo
Madrid / Spain
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform