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
vijay ingle
NA
2
648
Not able to print the value of multiple refcursor.
Aug 29 2019 8:27 AM
Not able to print the value of multiple refcursor in .net.
procedure :
CREATE
OR
REPLACE
PROCEDURE
getEmpNames
(
commissioned
IN
OUT
SYS_REFCURSOR,
salaried
IN
OUT
SYS_REFCURSOR
)
IS
BEGIN
OPEN
commissioned
FOR
SELECT
ename
FROM
emp
WHERE
comm
is
NOT
NULL
;
OPEN
salaried
FOR
SELECT
ename
FROM
emp
WHERE
comm
is
NULL
;
END
;
.net code
public
void
RefCursorSample(Connection con)
{
try
{
con.setAutoCommit(
false
);
String commandText =
"{call getEmpNames(?,?)}"
;
CallableStatement stmt = con.prepareCall(commandText);
stmt.setNull(1, Types.REF);
stmt.registerOutParameter(1, Types.REF);
stmt.setNull(2, Types.REF);
stmt.registerOutParameter(2, Types.REF);
stmt.execute();
ResultSet commissioned = (ResultSet)stmt.getObject(1);
System.
out
.println(
"Commissioned employees:"
);
while
(commissioned.next())
{
System.
out
.println(commissioned.getString(1));
}
ResultSet salaried = (ResultSet)stmt.getObject(2);
System.
out
.println(
"Salaried employees:"
);
while
(salaried.next())
{
System.
out
.println(salaried.getString(1));
}
}
catch
(Exception err)
{
System.
out
.println(
"An error has occurred."
);
System.
out
.println(
"See full details below."
);
err.printStackTrace();
}
}
Reply
Answers (
3
)
http //supplement4reviews com/tone-garcinia-pharmacie/
Timeout expired