Micro Focus QTP (UFT) Forums
Calling a Oracle Stored Procedure from QTP. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Calling a Oracle Stored Procedure from QTP. (/Thread-Calling-a-Oracle-Stored-Procedure-from-QTP)



Calling a Oracle Stored Procedure from QTP. - geethwind - 07-21-2009

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


RE: Calling a Oracle Stored Procedure from QTP. - geethwind - 07-21-2009

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,


RE: Calling a Oracle Stored Procedure from QTP. - geethwind - 07-24-2009

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.


RE: Calling a Oracle Stored Procedure from QTP. - prasadsbrk - 08-14-2009

Hi,

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

Thanks