AutoDefineStorage: Boolean;
The AutoDefineStorage property determines whether data saving settings are automatically defined at query saving.
The property is relevant if query parameters are changed. Possibility of data saving is automatically enabled on setting the value to the property for the query.
If the property is set to True, automatic definition of the table is set on query saving.
If the property is set to False, the IQueryStorage.Table or IQueryStorage.TableName properties should be used for table specification.
By default the property is set to False.
Executing the example requires that the repository contains the Query object with the Query_1 identifier.
Sub UserProc;
Var
MB: IMetabase;
Query: IQuery;
Begin
MB := MetabaseClass.Active;
Query := MB.ItemById("Query_1").Edit As IQuery;
Query.Sql := "Select Value, VData From TestTable";
Query.AutoDefineStorage := True;
(Query As IMetabaseObject).Save;
End Sub UserProc;
After executing the example, the text of the specified query is changed. At query saving possibility of data saving is enabled. The table used for saving is determined from the query text.
See also: