FireDAC.Comp.Client.TFDCustomConnection.RefreshMetadataCache

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type:
procedure
function
Visibility: public
Source:
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
Unit: FireDAC.Comp.Client
Parent: TFDCustomConnection

Delphi

procedure RefreshMetadataCache(const AObjName: String = '');

C++

void __fastcall RefreshMetadataCache(const System::UnicodeString AObjName = System::UnicodeString());

Description

Invalidates the metadata cache.

The RefreshMetadataCache method discards cached metadata, like stored procedure definitions and table primary keys. 

If AObjName is specified, then the cached metadata are discarded:

  • For all tables with the AObjName name.
  • For all package with the AObjName name.
  • For all stored procedures with the AObjName name.

If AObjName is an empty string (default value), then all connection cached metadata are discarded. 

Call this method if the DB metadata has been changed and therefore the cached metadata is invalid. The metadata is cached by datasets, if fiMeta is included into TFDFetchOptions.Cache.

Example

FDConnection1.ExecSQL('alter table mytab drop primary key');
FDConnection1.RefreshMetadataCache;

See Also