Open topic with navigation
In the following example, lr_db_executeSQLStatement submits a query to a database. The dataset is pointed to by MyDataset and the number of rows in the dataset is saved to the NumRows variable.
NumRows = lr_db_executeSQLStatement("StepName=PerformQuery",
"SQLStatement=SELECT dbo.Customer.CustID, dbo.Customer.FirstName, dbo.Customer.LastName FROM dbo.Customer",
lr_output_message("The query returned %d rows.", NumRows);