dbcall
Calls the SQL stored procedure and returns the result of execution (result set and/or output parameters).
Syntax
dbcall PROFILE {SQL_STATEMENT}
Required Parameter
PROFILE
-
JDBC connect profile. You can configure the connect profile in the web console.
{SQL_STATEMENT}
-
SQL statement that calls the SQL stored procedure enclosed in a pair of curly braces(
{ }
). -
You can define input and output parameters that start with a colon (
:
) in the SQL query command.- The input parameter is defined in the form of
:name
, and a query parameter defined by the set command is inserted. - The output parameter is defined in the form of
:name(type)
. The available output parameter types arevarchar
,int
anddatetime
.
- The input parameter is defined in the form of
-
The output method is as follows:
- If the SQL query command returns only the output parameter, the
dbcall
command outputs 1 tuple consisting of the output parameter. - If the SQL query command returns the result set and output parameter, the
dbcall
command adds the output parameter field to all tuples of the result set and returns them. - If the SQL query command returns multiple result sets, the
dbcall
command loads all result sets and then outputs them.
- If the SQL query command returns only the output parameter, the
Usage
-
Load the column configuration of a specific table on a Microsoft SQL server.
dbcall mssql {call msdb.dbo.sp_columns("log_shipping_primaries")}
-
Load the
line
value with anid
of1000
as a user-defined procedure in Microsoft SQL Server.set id = 1000 | dbcall mssql {call GetLine(:id, :line(varchar))}