Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling a Oracle Stored Procedure from QTP.
#1
Not Solved
Hi..

I have to call an Oracle Stored Procedure sitting in a package with parameters from QTP.

When i try to give the below code , the app is giving me error @
"cm.Parameters(0).Value = "ROUTE_ROLLOVER" " step. as item cannot be found in the collection corresponding to the requested name or ordinal.

and the parameters.count is returning "0".

How can i call a stored proc inside the package using QTP?

my code:
======
Code:
cm.CommandType = 4 ' Stored Procedures
cm.CommandText = "P_CONFIG_SETTING.GetSetting"

cm.Parameters.Refresh
msgbox( cm.parameters.count)

' Pass input value. Assuming Stored Procedure requires 2 parameters
cm.Parameters(0).Value = "ROUTE_ROLLOVER"
cm.Parameters(1).Value = "TO_ADDRESS"

' Execute the stored procedure

Set rs = cm.execute()
any pointers are highly appreciated.

Thanks,
Geetha
Reply
#2
Not Solved
I resolved the above error and getting a new one now.

Code:
Set cm.ActiveConnection = conn

cm.CommandType = 4
cm.CommandText = "SDCF.P_CONFIG_SETTING.GetSetting"
cm.Parameters.Append cm.CreateParameter("P1",129,1,20,"ROUTE_ROLLOVER")
cm.Parameters.Append cm.CreateParameter("P2",129,1,20,"TO_ADDRESS")

cm.execute ' This line is giving an error GetSetting is not a procedure or undefined..

any pointers how to define the command text when giving the SP under a Oracle package?

TIA,
Reply
#3
Not Solved
Hi, the above error was occuring because the GetSetting is not a Stored Proc, it is a function.

I am able to call the functions successfully from QTP. But the problem is calling the stored proc which has the cursor parameter as OUT parameter.

Can anyone have done calling stored procs returning resultsets from QTP? any sample code is highly helpful.
Reply
#4
Not Solved
Hi,

Can you tell me how to call Stored Procs in QTP with good example including exception handling

Thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  calling QTP script from one to another krishnas.tester 3 6,741 11-12-2014, 10:32 AM
Last Post: vinod123
  Request Help | Usage of Oracle Add-In for Oracle SQL Developer Nasir Ahmed 3 3,559 06-18-2014, 04:28 PM
Last Post: vinod123
  Connection to oracle using JDBC and QTP dileep45 0 3,446 07-30-2013, 06:39 PM
Last Post: dileep45
  Need to put a value in editbox and the value is stored in a variable anushreebehura 2 2,677 05-10-2013, 03:03 PM
Last Post: SweetyChowdhury
  calling stored procedure from Oracle borisk 3 6,455 03-19-2013, 12:41 PM
Last Post: gaveyom

Forum Jump:


Users browsing this thread: 1 Guest(s)