This function creates a dataset populated with the results of an aSQL query, and is commonly used with SQL statements that return a dataset e.g. Select or Exec (when a procedure returns dataset).

The SQL query is executed against a DB Connection on the Destination side of the Map.

The dataset starts out populated with data from the results of the SQL query, and you can work with those records as necessary.

Refer to Dataset Class (TDataset) for information on what you can do with the dataset.

Declaration: procedure GetDataSetFromDest(const aDataSet : TFloClientDataSet; const aSQL: string; aDBIndex : Integer);

An example of the use of this function.

procedure OnMapEvent(var Value:Variant);
begin
//create dataset
GetDataSetFromDest(Data1,'select accno,name from dr_accs',0);
 
//read a value from the dataset
Value := Data1['Name'].Value;
end;

aDataSet should be a Global Dataset.

 aDBIndex indicates which of the DB Connections is used based on its zero based index.