f2s_esql_call_proc¶
Applies to: Oracle, MS SQL, MySql/MariaDB, PostgreSQL Drivers
Syntax¶
f2s_esql_call_proc {name} [with {params}]
Parameter |
Description |
|---|---|
name |
Full name of the procedure |
params |
Optional, input parameters in order. |
Description¶
This command is used to set the name of a predefined SQL Stored Procedure along with its imput parameters. Once this command has been called, an interface is instantiated to handle the call. It is similiar to f2s_esql_set_proc_name, except there is no need to call f2s_esql_set_proc_param after calling f2s_esql_prepare_stmt.
This command does not accept the “using” statement.
Note
For MS SQL this can be either “ProcName” or “schema.ProcName”
For Oracle it can be “ProcName”, “Schema.ProcName”, “Package.ProcName” or “Schema.Package.ProcName”
For MS SQL the scope of this call is the current database set via the f2s_db_name attribute. If no database has been set, the default database for the login will be used.
You MUST instanciate ALL parameters passed to the call (move value to myParameter). Failure to do so will result in a “COM object method invocation error”.
Examples¶
- SQL Server Code to create a simple Stored Procedure ‘dbo.TEST’ that takes an integer input and adds 40 to the ‘OUTPUT’ parameter
CREATE PROCEDURE [dbo].[Test] @iNum1 int = 0, @iNum2 int = 0 OUTPUT AS set @iNum2 = @iNum1+40
- DataFlex code to call the SQL Server ‘TEST’ Stored Procedure under the ‘.dbo’ schema
Integer iNum //VERY IMPORTANT, if you don't instanciate the variable, it will throw a "COM object method invocation error" when running the command move 0 to iNum f2s_esql_call_proc "dbo.Test" with 10 iNum f2s_esql_execute_proc Showln iNum