Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
calling stored procedure from Oracle
#1
Not Solved
I am not really a QTP or even QA Specialist, but it so happened I am
helping a lady in my office to write a code to call a stored procedure
in Oracle. It is supposed to take two parameters, do something with
them and return the result set.
We are having trouble passing the parameters, so I decided to write a
version of this stored procedure which has no input parameters but
still returns a results set.

Basically the code is like this:
Code:
create or replace procedure XYZ(p_results OUT SYS_REFCURSOR) AS
  BEGIN
..
  open p_results for SELECT 'ABC' from dual;
  END;
When I test it through Oracle SQL Developer it works fine.

However, when we try to call it through QTP we get en error:
Code:
Set conn={create connection}

set cmd=Server.createObject("ADODB.Command")
Set smc.ActiveConnection=conn
cmd.CommandText="XYZ"
cmd.CommandType = 4 ' adCmdStoredProc

cmd.Parameters.Refresh
set rs = cmd.execute
Do Until rs.BOF Or rs.EOF
  print ...
Loop

We get an error:
[Microsoft] ODBC Driver for Oracle][Oracle]ORA-06550: line 1, column 7:
PLS - 00306: wrong number or typrs of arguments in call to 'XYZ'
ORA-06550: Line 1, column 7:
PL/SQL: Statement ignored

Line(57): "Set rs=cmd.Execute".

=====

It seems that Oracle is expecting some kind of a definition of this
ouitput parameter anyway.

What are we doing wrong?



Thanks
Reply


Messages In This Thread
calling stored procedure from Oracle - by borisk - 12-18-2012, 07:31 PM
RE: calling stored procedure from Oracle - by krr - 12-31-2012, 05:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  calling QTP script from one to another krishnas.tester 3 6,485 11-12-2014, 10:32 AM
Last Post: vinod123
  Request Help | Usage of Oracle Add-In for Oracle SQL Developer Nasir Ahmed 3 3,340 06-18-2014, 04:28 PM
Last Post: vinod123
  Need to put a value in editbox and the value is stored in a variable anushreebehura 2 2,437 05-10-2013, 03:03 PM
Last Post: SweetyChowdhury
  Function is not calling from subdriver qtpexpert 0 1,988 01-18-2013, 12:25 PM
Last Post: qtpexpert
  While calling sub procedure its giving error Akhila 1 2,346 10-22-2012, 01:55 PM
Last Post: harishshenoy

Forum Jump:


Users browsing this thread: 1 Guest(s)