Retrieving Schema Information
Schema Information (lists of available database objects) can be retrieved using some specialized calls in TSQLConnection:
These calls are pretty straightforward and need little explanation. A more versatile system is the schema info query: the TCustomSQLQuery.SetSchemaInfo method can be used to create a result set (dataset) with schema information. The parameter SchemaType determines the resulting information when the dataset is opened. The following information can be requested:
- Retrieves the list of user Tables in database. This is used internally by TSQLConnection.GetTableNames.
- Retrieves the list of system Tables in database. This is used internally by TSQLConnection.GetTableNames when the system tables are requested
- Retrieves a list of stored procedures in database. This is used internally by TSQLConnection.GetProcedureNames.
- Retrieves the list of columns (fields) in a table. This is used internally by TSQLConnection.GetFieldNames.
- This retrieves the parameters for a stored procedure.
- Retrieves the indexes for one or more tables. (currently not implemented)
- Retrieves packages for databases that support them. (currently not implemented).