CallProcedure

Description

Call a relational database's stored procedure and obtain the result .

Syntax

Function CallProcedure( proc_name, input_params, output_params )

Parameters

string proc_name  - name of the procedure to call

array  input_params - input parameters for the procedure

array  output_params  - output parameters

Example

Let's say we have created a procedure in Transact-SQL:

CREATE PROCEDURE [dbo].[p_MyProc] @par1 varchar(255), @par2 varchar(255), @par3 varchar(255), @out1 int OUTPUT, @out2 int OUTPUT AS

BEGIN

    @out1 = 1   

    @out2 = 2

    return 3

END

Then we can call it as follows:

Dim output, retval

retval = this.DSOut.CallProcedure( "p_MyProc", Array( "val1", "val2", "val3" ), output )

Values after the call:

IsArray( output ) = true

output(0) = 1

retval = 3

Return Values

integer - procedure's return value

See also

CallFunction

Execute

DS