TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jsue Ngron
NA
14
1.2k
C# Calling PACKAGE.PROCEDURE with OUT parameter
Jan 19 2017 1:06 PM
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!
Reply
Answers (
7
)
Generate columns from a table column having XML string
write select stmt using linq