Cannot call a procedure from asp.net

Wednesday, July 9, 2014


create or replace PROCEDURE TESTPROC
(
sourceId in VARCHAR,
transId in VARCHAR,
resultValue out varchar
)
is
-- declarations
amount number;

BEGIN
insert into testtt(column1) values('begin ');
resultValue:=0;
EXCEPTION
WHEN NO_DATA_FOUND THEN
insert into testtt(column1) values('exception');
resultValue:=0;

END TESTPROC;


i am trying to call it from a vb page (asp.net )



'open connection here
Dim procedureName As String = "TESTPROC"
Command = New OdbcCommand("{Call " & procedureName & "(?,?,?)}", conn)
Command.Parameters.Add(New OdbcParameter("sourceId", OdbcType.VarChar, 45))
Command.Parameters.Add(New OdbcParameter("transId", OdbcType.VarChar, 45))
Command.Parameters.Add(New OdbcParameter("resultValue", OdbcType.VarChar, 45))

Command.Parameters("sourceId").Value = "1"
Command.Parameters("transId").Value = id.ToString
Command.CommandType = Data.CommandType.StoredProcedure
Command.Parameters("sourceId").Direction = ParameterDirection.Input
Command.Parameters("transId").Direction = ParameterDirection.Input
Command.Parameters("resultValue").Direction = ParameterDirection.Output
Command.ExecuteNonQuery()


i got these exceptions :



ORA-01722: invalid number


ORA-06512: at "DB.TESTPROC", line 25


ORA-06512: at line 1



i don't know what i did wrong ,can any one help me please.







http://ift.tt/1kCW7ZL