You are here: Scripting Reference > Functions > Database > GetDataSetFromSource

GetDataSetFromSource

Declaration

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

Example

procedure OnMapEvent(var Value:Variant);

begin

GetDataSetFromSource(Data1,'select accno,name from dr_accs',0); //create dataset

Value := Data1['Name'].Value; //read a value from the dataset

end;

Description

Creates a dataset populated with the results of the aSQL query. aDataSet should be one of the See "Global Datasets"

 

This is commonly used with SQL statements that return a dataset eg Select or Exec (when procedure returns dataset)

 

The SQL query is executed against a DB Connection on the Source of the map. aDBIndex indicates which of the DB Connections is used based on its zero based index.

 

The dataset starts populated with data from the results of the SQL query and you can work with those records as necessary. Refer to See "Data Set" class for information on what you can do with the dataset.