Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update SP from VB.Net

Status
Not open for further replies.

bobhagan

MIS
Apr 28, 2001
111
US
I'm trying to run an update from an ASP.net application, using the MS Oracle Provider. The stored procedure is generated from a CodeSmith template. I'm getting an Oracle error "Wrong number or type of parameters"

For test purposes I reduced the table to two fields, the primary key - client_id, and client_name. The client_id param works just fine in calling a SELECT stored proc.

WITH cmd
.Parameters.Add(New OracleParameter("p_client_id", OracleType.VarChar, 16)).Value = mclient_id
.Parameter.Item("p_client_id").Direction = ParameterDirection.Input
.Parameters.Add(New OracleParameter("p_client_name", OracleType.VarChar, 30)).Value = mclient_name
.Parameter.Item("p_client_name").Direction = ParameterDirection.Input

.ExecuteNonQuery()
End With
The stored Procedure goes:

CREATE OF REPLACE PACKAGE PK_CLIENT
IS

PROCEDURE UPDATE_CLIENT_ROW
( p_CLIENT_ID in CLIENT.CLIENT_ID%type,
p_CLIENT_NAME in CLIENT.CLIENT_NAME%type);
END PK_CLIENT;
/

CREATE OR REPLACE PACKAGE BODY PK_CLIENT
IS

PROCEDURE UPDATE_CLIENT_ROW
( p_CLIENT_ID in CLIENT.CLIENT_ID%type,
p_CLIENT_NAME in CLIENT.CLIENT_NAME%type)

is
begin

update CLIENT
set
CLIENT_ID = p_CLIENT_ID,
CLIENT_NAME = p_CLIENT_NAME
where
CLIENT_ID = p_CLIENT_ID;
end UPDATE_CLIENT_ROW;

END PK_CLIENT;
/

Seems simple enough, but just doesn't work.
Bob Hagan

 
I must have had a typo somewhere. This does now work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top