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
Lance Hutchinson
NA
5
2.1k
PL/SQL numeric or value error in C#
May 17 2013 4:59 AM
Hi
i am trying to retrieve a value from my database through a stored procedure. i get a PL/SQL numeric or value error when i run the code.
PL/SQL
create or replace
PROCEDURE PROD_PASSWORD
(
PR_USERNAME IN VARCHAR2
, PWORD OUT VARCHAR2
) AS
BEGIN
select p_password into pword from tbl_personnel where p_username = pr_username;
END PROD_PASSWORD;
C#
string
oradb =
"Data Source=localhost:1521/XE;User Id=system;Password=Blue1960;"
;
OracleConnection
conn =
new
OracleConnection
(oradb);
// C#
conn.Open();
OracleCommand
cmd =
new
OracleCommand
(
"PROD_PASSWORD"
, conn);
cmd.BindByName =
true
;
cmd.CommandType =
CommandType
.StoredProcedure;
cmd.Parameters.Add(
"PR_USERNAME"
,
OracleDbType
.Varchar2, txtUsername.Text,
ParameterDirection
.Input);
cmd.Parameters.Add(
"PWORD"
,
OracleDbType
.Varchar2,
ParameterDirection
.ReturnValue);
cmd.ExecuteNonQuery();
txtPassword.Text = cmd.Parameters[
"PWORD"
].Value.ToString();
conn.Dispose();
Thanks in advance
Reply
Answers (
2
)
Get the list of sp name from the package from oracle by C#
sheet same values i need to insert into table