The list of questions and answers related to the metadata retrieval.
A: There are two basic methods:
1)
try ADQuery1.Open('select * from tab where 0 = 1'); Result := True; except on E: EADDBEngineException do if E.Kind = ekObjNotExists then Result := False else raise; end;
2)
var oList: TStrings; begin oList := TStringList.Create; try GetTableNames('', '', ATableName, oList, [osMy, osOther, osSystem], [tkTable, tkTempTable, tkLocalTable]); Result := oList.Count > 0; finally oList.Free; end; end;
The first one is more optimal.
A: The following code returns a list of procedures for the PACKAGE_NAME Oracle package.
ADMetaInfoQuery1.BaseObjectName := 'PACKAGE_NAME'; ADMetaInfoQuery1.MetaInfoKind := mkProcs; ADMetaInfoQuery1.Open;
A: The following code returns a list of indexes for the MY_TAB table.
ADMetaInfoQuery1.ObjectName := 'MY_TAB'; ADMetaInfoQuery1.MetaInfoKind := mkIndexes; ADMetaInfoQuery1.Open;
A: AnyDAC has two general connection definition parameters - MetaDefCatalog and MetaDefSchema. Depending on DBMS either or both of them are supported (see AnyDAC Database Connectivity for details). If object belongs to a specified MetaDefCatalog catalog / MetaDefSchema schema, then this catalog / schema name will be excluded from an object name. So, set MetaDefCatalog / MetaDefSchema to your development catalog / schema name, if you need to deploy your application to different catalog / schema.
A: AnyDAC has two general connection definition parameters - MetaCurCatalog and MetaCurSchema. Depending on DBMS either or both of them are supported (see AnyDAC Database Connectivity for details). Setting them to '*' will avoid usage of a corresponding name part in a full object name.
|
What do you think about this topic? Send feedback!
|