This is mysql
routine(store procedure)...
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `InUser`(
IN Id INTEGER,
In UId Integer,
In UIdTo Integer,
out R_Id Integer
)
BEGIN
IF Id = 0 THEN
insert into test.main
select (SELECT COALESCE(max(test.main.Id),0)+1 FROM test.main) as id,UId as uid;
insert into test.main
select (SELECT max(test.main.Id) FROM test.main) as id,UIdTo as uid;
set R_Id = (select max(id) from test.main);
Else
insert into test.main
select test.main.Id as id,UIdTo as uid;
set R_Id = (select max(test.main.id) from test.main);
End If;
END
ASP CODE is as below...
<html>
<body>
<form >
<%
MsgBox "Hello, World!"
on error resume next
Set OBJdbConnection1 = Server.CreateObject("ADODB.Connection")
OBJdbConnection1.ConnectionTimeout = Session("ConnectionTimeout")
OBJdbConnection1.CommandTimeout = Session("CommandTimeout")
OBJdbConnection1.Open Session("ConnectionString")
dim Uid,Id
Uid = 1'request.form("Uid")
Id = 0'request.form("Id")
Set SQLStmt1 = Server.CreateObject("ADODB.Command")
Dim sqlstr, result
sqlstr = "InUser";
SQLStmt1.CommandText = sqlstr
SQLStmt1.CommandType = adCmdStoredProc
Set SQLStmt1.ActiveConnection = OBJdbConnection1
SQLStmt1.Parameters.Append(SQLStmt1.createParameter("Id",adInteger,adParamInput,50,Id))
SQLStmt1.Parameters.Append(SQLStmt1.createParameter("UId", adInteger,adParamInput,50,Session("UId")))
SQLStmt1.Parameters.Append(SQLStmt1.createParameter("ToUId",adInteger,adParamInput,50,Uid))
SQLStmt1.Parameters.Append(SQLStmt1.createParameter("R_id",adInteger,adParamOutput,50,Id))
result = OBJdbConnection.Execute(sqlstr)
id=SQLStmt1.Parameters("R_id").value
response.write(id)
%>
</form >
</body>
</html>
not showing error or messagebox
and not calling sp
please help