JavaScript手册 
目录
此参考中包含
的内容
轻松上手
简介
操作符
语句
核心
文档
窗口
表单
浏览器
事件和
事件句柄
LiveWire
数据库服务
进程管理服务
实用工具
全局函数
LiveConnect
的Java包
索引
版权
 
【目录】 【上一页】 【下一页】 【索引】

Stproc

Represents a call to a database stored procedure.

服务器端对象
实现版本Netscape Server 3.0

创建源

The storedProc method of the database object or of a Connection object. You do not call a Stproc constructor.

描述

When finished with a Stproc object, use the close method to close it and release the memory it uses. If you release a connection that has an open stored procedure, the runtime engine waits until the stored procedure is closed before actually releasing the connection.

If you do not explicitly close a stored procedure with the close method, the JavaScript runtime engine on the server automatically tries to close all open stored procedures when the associated database or Connection object goes out of scope. This can tie up system resources unnecessarily. It can also lead to unpredic表 results.

You can use the prototype property of the Stproc class to add a property to all Stproc instances. If you do so, that addition applies to all Stproc objects running in all applications on your server, not just in the single application that made the change. This allows you to expand the capabilities of this object for your entire server.

属性概览

prototypeAllows the addition of properties to a Stproc object.

方法概览

closeCloses a stored-procedure object.
outParamCountReturns the number of output parameters returned by a stored procedure.
outParametersReturns the value of the specified output parameter.
resultSetReturns a new result set object.
returnValueReturns the return value for the stored procedure.

属性

prototype

Represents the prototype for this class. You can use the prototype to add properties or methods to all instances of a class. For information on prototypes, see Function.prototype.

属性源Stproc
实现版本LiveWire 1.0

方法

close

Closes the stored procedure and frees the allocated memory.

方法源Stproc
实现版本Netscape Server 3.0

语法

close()

参数

无。

返回

0 if the call was successful; otherwise, a nonzero status code based on any error message passed by the database. If the method returns a nonzero status code, use the associated majorErrorCode and majorErrorMessage methods to interpret the cause of the error.

描述

The close method closes a stored procedure and releases the memory it uses. If you do not explicitly close a stored procedure with the close method, the JavaScript runtime engine on the server automatically closes it when the corresponding client object goes out of scope.

outParamCount

Returns the number of output parameters returned by a stored procedure.

方法源Stproc
实现版本Netscape Server 3.0

语法

outParamCount()

参数

无。

返回

The number of output parameters for the stored procedure. Informix stored procedures do not have output parameters. Therefore for Informix, this method always returns 0. You should always call this method before calling outParameters, to ensure that the stored procedure has output parameters.

outParameters

Returns the value of the specified output parameter.

方法源Stproc
实现版本Netscape Server 3.0

语法

outParameters (n)

参数

nZero-based ordinal for the output parameter to return.

返回

The value of the specified output parameter. This can be a string, number, double, or object.

描述

Do not use this method for Informix stored procedures, because they do not have output parameters.

You should always call the outParamCount method before you call this method. If outParamCount returns 0, the stored procedure has no output parameters. In this situation, do not call this method.

You must retrieve result set objects before you call this method. Once you call this method, you can't get any more data from a result set, and you can't get any additional result sets.

resultSet

Returns a new result set object.

方法源Stproc
实现版本Netscape Server 3.0

语法

resultSet ()

参数

无。

描述

Running a stored procedure can create 0 or more result sets. You access the result sets in turn by repeated calls to the resultSet method. See the描述 of the Resultset for restrictions on when you can use this method access the result sets for a stored procedure.

spobj = connobj.storedProc("getcusts"); // Creates a new result set object
resobj = spobj.resultSet();

returnValue

Returns the return value for the stored procedure.

方法源Stproc
实现版本Netscape Server 3.0

语法

returnValue()

参数

无。

返回

For Sybase, this method always returns the return value of the stored procedure.

For Oracle, this method returns null if the stored procedure did not return a value or the return value of the stored procedure.

For Informix, DB2, and ODBC, this method always returns null.

描述

You must retrieve result set objects before you call this method. Once you call this method, you can't get any more data from a result set, and you can't get any additional result sets.


【目录】 【上一页】 【下一页】 【索引】

回页面顶部