|
|
|
|
|
|
| Author |
Message |
harp *nix forums beginner
Joined: 08 Feb 2005
Posts: 12
|
Posted: Thu Feb 10, 2005 5:49 pm Post subject:
Re: Calling stored procedures in c++ via odbc
|
|
|
If I do the following und sql*plus for e.g. I get the following:
Argument Name Typ In/Out
Defaultwert?
------------------------------ ----------------------- ------ --------
FIRSTNAME REF CURSOR IN/OUT
FAMILYNAME REF CURSOR IN/OUT
ADDRESS REF CURSOR IN/OUT
TELNO REF CURSOR IN/OUT
COMP VARCHAR2 IN
How can I define the types in my development environment (c++)?
It seems not to be recorgnized automatically. |
|
| Back to top |
|
 |
harp *nix forums beginner
Joined: 08 Feb 2005
Posts: 12
|
Posted: Thu Feb 10, 2005 3:47 pm Post subject:
Re: Calling stored procedures in c++ via odbc
|
|
|
still in need of help....
is my problem so simple or not well described, still waiting for some
suggestions...
regards,
harp |
|
| Back to top |
|
 |
harp *nix forums beginner
Joined: 08 Feb 2005
Posts: 12
|
Posted: Thu Feb 10, 2005 8:51 am Post subject:
Calling stored procedures in c++ via odbc
|
|
|
I have the following done in sql*plus
DROP PACKAGE ODBCRefCus;
CREATE PACKAGE ODBCRefCus AS
TYPE firstname_cus IS REF CURSOR;
TYPE familyname_cus IS REF CURSOR;
TYPE address_cus IS REF CURSOR;
TYPE telno_cus IS REF CURSOR;
PROCEDURE spEmpCus(Firstname IN OUT firstname_cus, Familyname IN OUT
familyname_cus, Address IN OUT address_cus, Telno IN OUT telno_cus,
comp IN
VARCHAR2);
END;
/
CREATE PACKAGE BODY ODBCRefCus AS
PROCEDURE spEmpCus(Firstname IN OUT firstname_cus, Familyname IN OUT
familyname_cus, Address IN OUT address_cus, Telno IN OUT telno_cus,
comp IN
VARCHAR2)
AS
BEGIN
IF NOT Firstname%ISOPEN
THEN
OPEN Firstname for SELECT firstname FROM customers WHERE
firm = comp;
END IF;
IF NOT Familyname%ISOPEN
THEN
OPEN Familyname for SELECT familyname FROM customers WHERE firm =
comp;
END IF;
IF NOT Address%ISOPEN
THEN
OPEN Address for SELECT address FROM customers WHERE firm = comp;
END IF;
IF NOT Telno%ISOPEN
THEN
OPEN Telno for SELECT telno FROM customers WHERE firm = comp;
END IF;
END;
END;
/
I was able to compile.
nd in my c++ program:
Assuming that all about the connections were okay
AnsiString stmt = "CALL ODBCRefCus.spEmpCus(?,?,?,?,'firm')";
//AnisString(borlands) is just a string
retcode =
SQLBindParameter(hstmt,1,SQL_PARAM_INPUT_OUTPUT,SQL_C_CHAR,SQL_C_CHAR,
sizeof(?),0,?,0,&firstnameId);
My problem is: what type do I use to bind for ? as parameters. If I use
AnsiString/string/char* - it gets problem with execution.
retcode = SQLExecute(hstmt);
And gives error message of ora-06553: pls-306 wrong number or type of
arguments.
NB: I do use oracle9i, c++builder6
I'm quite in need of your help.
Regards,
Harp |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Thu Jan 08, 2009 2:02 am | All times are GMT
|
|
Facebook Proxy | PunBB forum hosting | Guitar Lesson | Power Rangers | Mortgage Calculator
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|