Example: lr_db_getValue

In the following example, lr_db_getValue retrieves the first name of three rows in the dataset created by lr_db_executeSQLStatement. The first name is saved in the parameter MyOutputParam.

int i=1;
lr_db_executeSQLStatement("StepName=PerformQuery", "ConnectionName=db1", 
    "SQLStatement=SELECT dbo.Customer.CustID, dbo.Customer.FirstName, dbo.Customer.LastName FROM dbo.Customer", 
    "DatasetName=MyDataset", LAST );

while (i<4) {
    lr_db_getvalue("StepName=GetValue",   
      "DatasetName=MyDataset", 
        "Column=FirstName", 
         "Row=next", 
        "OutParam=MyOutputParam", 
        LAST );
    lr_output_message("The value is: %s", lr_eval_string("{MyOutputParam}") );
    i=i+1;
    }