Stored procedure

zhaozj2021-02-16  128

The stored procedure uses the Daquan 2002-2-19 moving network pioneer

1. Call the stored procedure without parameters <% set conn = server.createObject ("adodb.connection") set cmd = server.createObject ("adoDb.command") strconn = "DSN = PUBS; UID = SA; PWD"

Conn.open strconnset cmd.activeconnection = conn

cmd.commandtext = "{call nono}"

'set RS = cmc.exe or cmd.execute

SET RS = cmd.execute ()

%> 2, a stored procedure of an input <% set conn = server.createObject ("adoDb.connection") set cmd = server.createObject ("adoDb.command") strconn = "DSN = PUBS; UID = SA; PWD "

Conn.open strconnset cmd.activeconnection = conn

CMD.Commandtext = "{call oneInput (?)}" cmd.parameters.Append cmd.createParameter ("@ aaa", adINteger, adhangaminput) cmd ("@ aaa") = 100

cmd.execute ()

%> 3, an input parameter and an output parameter <% set conn = server.createObject ("adoDb.connection") set cmd = server.createObject ("adoDb.command") strconn = "DSN = PUBS; UID = SA ; PWD "

Conn.open strconnset cmd.activeconnection = conn

cmd.commandtext = "{CALL Oneinout (?,?)}" cmd.parameters.append cmd.createparameter ("@ aaa", adINteger, adhangaminput) cmd ("@ aaa") = 10cmd.parameters.Append cmd.createParameter "@BBB", Adinteger, ADPARAMOUTPUT)

cmd.execute ()

BBB = CMD ("@ bbb")%> 4, an input parameter, an output parameter, and a return value <% set conn = server.createObject ("adodb.connection" SET cmd = server.createObject ("AdoDB. Command ") StrConn =" DSN = PUBS; UID = SA; PWD "

Conn.open strconnset cmd.activeconnection = conn

cmd.commandtext = "{? = CALL ANDRETURN (?,?)}"

cmd.Parameters.Append cmd.CreateParameter ( "@ return_value", adInteger, adParamReturnValue) cmd.Parameters.Append cmd.CreateParameter ( "@ aaa", adInteger, adParamInput) cmd ( "@ aaa") = 10cmd.Parameters.Append cmd .CreateParameter ("@ bbb", adINteger, adparamoutput) cmd.execute ()

BBB = cmd ("@ bbb") rrr = cmd ("@ Return_Value")%>

转载请注明原文地址:https://www.9cbs.com/read-8331.html

New Post(0)