Skip to content

TCustomSQLQuery.SetSchemaInfo

SetSchemaInfo prepares the dataset to retrieve schema info.

Declaration

Source position: sqldb.pp line 624

public 
procedure TCustomSQLQuery.SetSchemaInfo(ASchemaType: TSchemaType; 
                                       ASchemaObjectName: string; 
                                       ASchemaPattern: string);  virtual;

Description

SetSchemaInfo will prepare the dataset to retrieve schema information from the connection, and represents the schema info as a dataset.

SetSchemaInfo is used internally to prepare a query to retrieve schema information from a connection. It will store the 3 passed parameters, which are then used in the ParseSQL and Prepare stages to optimize the allocated resources. setting the schema type to anything other than stNoSchema will also set (or mimic) the SQL statement as soon as the query is prepared. For connection types that support this, the SQL statement is then set to whatever statement the database connection supports to retrieve schema information.

This is used internally by TSQLConnection.GetTableNames and TSQLConnection.GetProcedureNames to get the necessary schema information from the database.

See also

Name Description
TSQLConnection.GetTableNames Get a list of the tables in the specified database.
TSQLConnection.GetProcedureNames Gets a list of Stored Procedures in the Database.
RetrievingSchemaInformation Retrieving Schema Information.