OO4O with PL/SQL stored procedure exmaple -- Need Help!!
Date: 1998/02/05
Message-ID: <6bd288$bd_at_segfault.isr.umd.edu>#1/1
Hi, I have a problem with OO4OLE calling a PL/SQL stored procedure example
in an online document.
package body Employee as
...
...
select * from emp where deptno = indeptno;
END;
end employee;
and in my source code(VC++ 5.0) I called it like this:
m_database.Open("dbname", "login/password", 0);
OParameterCollection params = m_database.GetParameters();
I made a package "employee" as in an example like this:
package Employee as
type NUMARRAY is table of NUMBER index by BINARY_INTEGER; --Define
EMPNOS ar
ray
type VCHAR2ARRAY is table of VARCHAR2(10) index by BINARY_INTEGER;
--Define
ENAMES array
cursor c1 is select * from emp;
type empCur is ref cursor return c1%rowtype;
PROCEDURE GetEmpData(indeptno IN NUMBER, EmpCursor IN OUT empCur);
PROCEDURE GetEmpNamesInArray (ArraySize IN INTEGER, inEmpnos IN NUMARRAY,
outEm
pNames OUT VCHAR2ARRAY);
PROCEDURE GetEmpName (inEmpno IN NUMBER, outEmpName OUT VARCHAR2);
FUNCTION GetEmpSal (inEmpno IN NUMBER) RETURN NUMBER;
end Employee;
PROCEDURE GetEmpData(indeptno IN NUMBER, EmpCursor IN OUT empCur) is
BEGIN
open EmpCursor for
if (m_dynaset.PlsqlOpen(m_database,
"Begin Employee.GetEmpData (:DEPTNO, :p_cursor); end;", "EmpCursor", ODYNASET_DEFAULT)) { char buf[256]; sprintf(buf, "%s",m_dynaset.GetErrorText()); MessageBox(buf); exit(1); }
....
I have an error message saying:
"Output data binding error, ORA-01036: illegal variable name/number"
I don't know much about oracle PL/SQL, OO4O and even VC++, so it's not
easy
for me to see what makes this problem. I'm running VC++ 5.0 in NT with
Oracle 7.3.
Do I have to do something with p_cursor? Where this one declared with what type?
Would you tell me what I missed in here? Appreciate your help.
Regards,
Kap Jang
(202)283-4931
kapdo_at_isr.umd.edu
Received on Thu Feb 05 1998 - 00:00:00 CET