Loadrunner web-services protocol can be used to execute DB queries
Action()
{
int retval;
int NumRows=0;
retval = lr_db_connect("StepName=DatabaseConnection",
"ConnectionString=dsn=Test;userid=test; password=Test",
"ConnectionName=food",
"ConnectionType=ODBC",
LAST );
lr_start_transaction("Report");
NumRows = lr_db_executeSQLStatement("StepName=PerformQuery",
"ConnectionName=foodb",
"SQLStatement="
"select count(*) indv_knt, count(distinct lbi_hshl_id) hshl_knt,"
"count(distinct best_dmid_num) dmid_knt \r\nfrom "
"CDMZDATAVIEW.best_domestic_postal_addr where ctry_cd = 'US';",
"DatasetName=MyDataset",
LAST );
lr_end_transaction("Report", LR_AUTO);
lr_db_dataset_action("StepName=PrintDataset",
"DatasetName=MyDataset",
"Action=PRINT",
LAST );
lr_output_message("The query returned %d rows.", NumRows);
return 0;
}