Share this page

# 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;
        }

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: