Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Post
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
7
Reply
C# Calling PACKAGE.PROCEDURE with OUT parameter
Jsue Ngron
7 years ago
340
Reply
From C# Code, I'm trying to call a PACKAGE.PROCEDURE() from Oracle. In this simple example I should get one value from the procedure call, but all I get is error:
> wrong number or types of arguments in call to 'RETURN_NUM'
The procedure is declared as follows:
PROCEDURE
return_num(xNum
OUT
NUMBER)
AS
BEGIN
xNum:= 50;
dbms_output.put_line(
'hello world '
|| xNum);
END
;
C# code:
Oraclecon.Open();
OleDbCommand myCMD =
new
OleDbCommand(
"TEST.return_num"
, Oraclecon);
myCMD.CommandType = CommandType.StoredProcedure;
myCMD.Parameters.Add(
"xNum"
, OleDbType.Numeric);
OleDbDataReader myReader;
myReader = myCMD.ExecuteReader();
Can some one please point out what I'm doing wrong. Then in a real scenario I would like to call a procedure that returns a set of values from a custom Type, such as:
TYPE r_interface_data
IS
RECORD
(
object_id VARCHAR2(16),
obj_type VARCHAR2(32)
);
TYPE t_interfase_data
IS
TABLE
OF
r_interface_data;
How can I approach that. Thanks!
Post
Reset
Cancel
Answers (
7
)
Next Recommended Forum
Generate columns from a table column having XML string
write select stmt using linq