vb.net data:
Just a guess (I'm no Oracle wiz), try setting the direction of the first
Parameter to Output instead of ReturnValue.
hth
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
[quoted text, click to view] "Tom Rahav" <tomrahav@nospam.nospam> wrote in message
news:uQ4GAzL2FHA.3332@TK2MSFTNGP15.phx.gbl...
> Hello!
>
> I have the following SP (Oracle):
>
> ************************************************************************************************
> CREATE OR REPLACE PROCEDURE openorder (ordernum out number ,orderdate
> in date ,clinetnum IN NUMBER)
> IS
> begin
> INSERT INTO ORDERS (ORDER_NUM, CLIENT_NUM,ORDER_DT , STATUS)
> VALUES (ORDER_SEQ.NEXTVAL , clinetnum, orderdate, 'open');
> select ORDER_SEQ.CURRVAL into ordernum from ORDERS ;
> commit;
> end openorder ;
> /
> ************************************************************************************************
>
> Can someone please tell me how do I use this SP (sending parameters and
> getting the result back?
> I tried the following code, but I get error message ("worong number or
> types of arguments..."):
>
> cn.Open()
> Dim cmd As New OracleCommand("openorder", cn)
>
> cmd.CommandType = CommandType.StoredProcedure
>
> cmd.Parameters.Add(New OracleParameter("ordernum", OracleDbType.Int16,
> ParameterDirection.ReturnValue))
>
> cmd.Parameters.Add(New OracleParameter("orderdate", OracleDbType.Date,
> ParameterDirection.Input)).Value = DateTime.Parse("6/3/2003 8:00 AM")
>
> cmd.Parameters.Add(New OracleParameter("clinetnum", OracleDbType.Int16,
> ParameterDirection.Input)).Value = 2
>
> Dim dr As OracleDataReader = cmd.ExecuteReader()
>
> Doesn't work... :(
> Thanks!
> Tom.
>