Geeks Talk

Prepare for your Next Interview




Querying Thru LR

This is a discussion on Querying Thru LR within the LoadRunner forums, part of the Software Testing category; Hi, The objective is to find the response time for a set of SQL Queries which are to be given directly to the DB Server. Can anybody help me out ...


Go Back   Geeks Talk > Software Testing > LoadRunner

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 06-22-2008
Junior Member
 
Join Date: Jan 2007
Location: India
Posts: 6
Thanks: 0
Thanked 1 Time in 1 Post
vk.reju is on a distinguished road
Querying Thru LR

Hi,

The objective is to find the response time for a set of SQL Queries which are to be given directly to the DB Server. Can anybody help me out in "how to proceed", "the appropriate protocol to be use" & also if possible some sample scripts illustrating the procedure.

Thanks in advance.

- VK.Reju
Reply With Quote
The Following User Says Thank You to vk.reju For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 06-22-2008
Contributing Member
 
Join Date: Jan 2008
Location: Israel
Posts: 32
Thanks: 0
Thanked 3 Times in 3 Posts
shlomini is on a distinguished road
Re: Querying Thru LR

Hi,

Providing you have sql queries, you should use one of the following protocols in LoadRunner, connect to the database and run the query. The code is different in each of the protocols, I have included an example relevant for Oracle protocol

Protocols: adodb, odbc, oracle

Oracle protocol run query sample
lrd_ora8_handle_alloc(OraEnv1, STMT, &OraStm1, 0);
lrd_ora8_stmt(OraStm1, lr_eval_string(""), 1, 0, 0);
lrd_ora8_exec(OraSvc1, OraStm1, 0, 0, &uliRowsProcessed, 0, 0, 0, 0, 0);
lrd_handle_free(&OraStm1, 0);

You need to wrap these in a transaction and then you can montior the response time.

You also need to open connection to the database. If you record an application that connects to the database and run a query, you will get the exact staructure you are looking for.

If you are still using 8.1 version, you can find examples under \dat\scripts\infrastructure

Hope it helps
shlomini
Reply With Quote
  #3 (permalink)  
Old 06-24-2008
Junior Member
 
Join Date: Jan 2007
Location: India
Posts: 6
Thanks: 0
Thanked 1 Time in 1 Post
vk.reju is on a distinguished road
Re: Querying Thru LR

Hi,

Thank you for the reply.

But is there any other way to script without using and application that connects to the database?

I received few samples in java, but i want to know whether is it possible in C base scripting.
Reply With Quote
  #4 (permalink)  
Old 06-25-2008
Contributing Member
 
Join Date: Jan 2008
Location: Israel
Posts: 32
Thanks: 0
Thanked 3 Times in 3 Posts
shlomini is on a distinguished road
Re: Querying Thru LR

There is no way to query a database without connecting it first. If you can't use the protocols I have mentioned because you don't have a license for it, then you can write the code in C/C++ on your own. I think there is no standard in C for that, but C++ have it.
Reply With Quote
Reply

  Geeks Talk > Software Testing > LoadRunner


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Exforsys.com Querying Data with Oracle XQuery admin Web Design 0 05-04-2008 12:10 PM
Querying a DOM Document with XPath admin Web Design 0 04-21-2008 10:00 AM
Faster approach for querying zakirhere Database General 1 02-18-2008 08:15 AM


All times are GMT -4. The time now is 02:26 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved