正在加载图片...
282 SP3高级编程 Chinapub.com 下载 IN BEGI UPDATE Titles Price Price *(1 +@Percent /100) WHERE Type=@Typ SELECt @Max MAx(Price) fRom Titles END 这只是在执行更新后运行了一个简单的 SELECT语句,并将值赋给输出参数 现在可以改写 StoredProcedure. asp的代码从而获取变量@MAx的值。 Dim cmdUpdate Dim strype urPercent Get the form values strType s Request Form("lstTypes' curPercent Request Form("txtPercent) Tell the user what's being done Response. Write Updating all books& Set the properties of the command with cmdUpdate ActiveConnection strcon CommandText ="usp_UpdatePricesMax' 我们只是在集合中加入了另一个参数,但这次指定为输出参数。注意它并没有赋值,因 为其值将由存储过程提供,记住这是一个输出参数 Add the parameters Parameters Append .CreateParameter ("@Type", adVarwchar, adParamInput Parameters Append. CreateParameter ("@Percent, adcurrency, aramInput ParametersAppend CreateParameter (*@Max, adcurrency, adParamoutput) adExecuteNoRecord 一旦执行了这个过程,就可从集合中取得该值 Extract the output parameter, which the stored procedure has supplied to the parameters collection curMax = Parameters(*@Max') End with And finally tell the user what's happened Response. Write Procedure complete. ' lngrecs records were updated. <P> Response. Write "The highest price book is now.& Formatcurrency(curMax)这只是在执行更新后运行了一个简单的 S E L E C T语句,并将值赋给输出参数。 现在可以改写S t o r e d P r o c e d u r e . a s p的代码从而获取变量@ M A X的值。 我们只是在集合中加入了另一个参数,但这次指定为输出参数。注意它并没有赋值,因 为其值将由存储过程提供,记住这是一个输出参数。 一旦执行了这个过程,就可从集合中取得该值。 282计计ASP 3 高级编程 下载
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有