AnyDAC
ContentsIndexHome
PreviousUpNext
TADCustomManager.GetTableNames Method

Populates a string list with the names of tables in a DB.

Group
Links
Parameters 
Description 
const AConnectionName: string 
A connection name. 
const ACatalogName: string 
A catalog name. 
const ASchemaName: string 
A schema name. 
const APattern: string 
A LIKE pattern. 
AList: TStrings 
A list to fill. 
AScopes: TADPhysObjectScopes = [osMy] 
A object scopes. 

Call GetTableNames to retrieve a list of tables in a DB. 

AConnectionName is the connection name to use. 

ACatalogName, ASchemaName restrict table names to the catalog and schema. 

APattern is the LIKE-pattern filtering table names. 

AList is a TStrings descendant that receives the table names. Any existing strings are deleted from the list before GetTableNames adds the names of all the tables in a DB. 

AScopes restricts table names to the specified scopes. 

AKinds restricts tables to the specified object kinds. 

The table names are normalized - enclosed into quotes, if that is required, otherwise converted to default dictionary case. Specify the MetaDefSchema and/or MetaDefCatalog parameters in connection definition, to avoid these schema and/or catalog names in table names.

procedure GetTableNames(const AConnectionName: string; const ACatalogName: string; const ASchemaName: string; const APattern: string; AList: TStrings; AScopes: TADPhysObjectScopes = [osMy]; AFullName: Boolean = True);

Querying Metadata, TADMetaInfoQuery, TADCustomConnection.GetTableNames

ADManager.GetTableNames('myconn', 'NORTHWIND', 'DBO', 'ADQA%', '', ListBox1.Items,
  [osMy, osSystem, osOther], [tkTable, tkView]);
What do you think about this topic? Send feedback!