LoadRunner Support Forum
Showing results for 
Search instead for 
Do you mean 

lr_db_executeSQLStatement returns access violation

SOLVED
Go to Solution
Trusted Contributor Trusted Contributor

lr_db_executeSQLStatement returns access violation

When running the following statement against an Oracle DB:

 

        lr_db_executeSQLStatement("StepName=Find Order",
            "ConnectionName=ORDER",
            "SQLStatement=select * from btl_event where event_id = 103",
            "DatasetName=OrderEvents",
            LAST);

 

I get the following error:

 

Error: SQL Statement failed {"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."}

 

This SQL is valid when executing it in PL/SQL.  What is wrong here?

1 ACCEPTED SOLUTIONS
HPE Expert

Re: lr_db_executeSQLStatement returns access violation

I believe you should open a ticket to HP Support team. It looks very strange that this query isn't runing.

 

Just out of curiosity, can you run the same query but not askinf for all fields, just one/some of them? e.g.: select event_id,event_result from event where event_id = 103

 

maybe the asterisk causes an issue

11 REPLIES
HPE Expert

Re: lr_db_executeSQLStatement returns access violation

From which protocol did you try using it? As far as I remember this function was made availabile only for Web Services protocol, maybe this is the issue

Trusted Contributor Trusted Contributor

Re: lr_db_executeSQLStatement returns access violation

I am using the WebService protocol.  I can execute other queries successfully so I know it "can" work.  Just doesn't work in this simple case.  I don't want to write a complicated query if this simple one doesn't work.

HPE Expert

Re: lr_db_executeSQLStatement returns access violation

  1. You mention that other queries were executed successfully. Can you share an example?
  2. Can you share a larger snippet of the script? Maybe the failure is related to some other issue that is impossible to trace just by seeing this statement

 BTW: HP released a product called Service Test. It provides much broader set of capabilities around database interaction and its’ Vuser/script can run in LoadRunner as part of the scenario. I suggest you read more about it by checking http://www.hp.com/go/servicetest

Trusted Contributor Trusted Contributor

Re: lr_db_executeSQLStatement returns access violation

[ Edited ]

Running just this causes the exception.   I moved this code tot he vuser_init to remove the rest of my script for potientially causing an issue.

 

  lr_db_connect("StepName=Connect to DB",
   "ConnectionName=DB",
   "ConnectionString=Provider=OraOLEDB.Oracle.1;Data Source={DB_Source};Password={DB_Password};User ID={DB_Username}",
   "ConnectionType=OLEDB",
   LAST);

 

  lr_db_executeSQLStatement("StepName=Find Order",
   "ConnectionName=DB",
   "SQLStatement=select * from event where event_id = 103",
   "DatasetName=OrderEvents",
   LAST);

 

 

 

Believe it or not running this more complicated query works:

 

"SQLStatement=SELECT e.event_id, e.event_result,"
           " to_char(e.event_start, 'MM-DD-YYYY HH24:MI:SS') AS \"EVENT_START\","
           " to_char(e.event_end, 'MM-DD-YYYY HH24:MI:SS') AS \"EVENT_END\","
           " ERROR_MESSAGE from event e"
           " JOIN event_order o"
           " ON e.event_id = o.event_id"
           " WHERE e.event_result IS NOT NULL AND o.order_number = '{OrderNumber}'"

HPE Expert

Re: lr_db_executeSQLStatement returns access violation

I believe you should open a ticket to HP Support team. It looks very strange that this query isn't runing.

 

Just out of curiosity, can you run the same query but not askinf for all fields, just one/some of them? e.g.: select event_id,event_result from event where event_id = 103

 

maybe the asterisk causes an issue

Trusted Contributor Trusted Contributor

Re: lr_db_executeSQLStatement returns access violation

I actually do have one open.  I opened it on Oct 26th.  Still waiting for an answer. :(

Trusted Contributor Trusted Contributor

Re: lr_db_executeSQLStatement returns access violation

Thanks Shlomi!  The asterisk is what did it!  After placing the column names in the query it started to work!  It's funny that the LR documenation for this method doesn't list that as a limitation. 

 

Thanks for your help.  I gave you a Kudos!

HPE Expert

Re: lr_db_executeSQLStatement returns access violation

I will make sure it is documented for the next version.

 

Happy to see this is behind us :-)

HPE Expert

Re: lr_db_executeSQLStatement returns access violation

Just curious, but do we know if this is a limitation of the function in Vugen, or could it be that the Oracle database that the statement was being executed against is configured to not allow wild card queries? I seem to recall using a wild card in this function in the past, unless it has changed since version 9.1.

Cheers,

Shane Evans
Product Manager - HP LoadRunner
www.hp.com/go/loadrunner
Highlighted
Trusted Contributor Trusted Contributor

Re: lr_db_executeSQLStatement returns access violation

After reporting these findings to HP support,  support came back and said against the MS SQL server they were testing against,  a wild card query worked.  So the function may support it.  I will say that running the same query against PL/SQL with the wildcard works as well.  Unless the DB is setup so OLEDB calls cannot be wildcard,  it is setup to accept wildcard queries.

Occasional Advisor

Re: lr_db_executeSQLStatement returns access violation

My webservice Scritping get hanged very often when its started to compiling and Verifying the DB connection ? Have you people faced this issues. Am using Vugen 11.5 with webservice protocol