Skip to content

Stored Procedure

Purpose

Execute a stored procedure and return the results. Stored procedures are either UserDefined or are part of a reserved set provided with Platform 6.

Methods

Binding name: p6.sproc


Method: long buildDataSource(String procId, Map parameters, String dataSourceName, boolean appendToDataSource)

Execute a query which will create a new table in the database. The query is found with its identifier. The argument appendToDataSource specifies if you add the records in the table if it already exists.


Method: long buildDataSource(String procId, Map parameters, String dataSourceName)

Execute a query which will create a new table in the database. The query is found with its identifier. It will not append records in the table if it already exists.


Method: String[][] execute(String procedureId [, boolean ignoreResult])

Executes the procedure with its identifier. The response is the execution’s result as a list of list of Strings.

Note

You can add a last optional argument named ignoreResult. If true the response of the procedure will be ignored. If false the response is the execution’s result as a list of list of Strings.


Method: String[][] execute(String procedureId, Map parameters [, boolean ignoreResult])

Executes the procedure with its identifier and additional parameters. The response is the execution’s result as a list of list of Strings.

Note

You can add a last optional argument named ignoreResult. If true the response of the procedure will be ignored. If false the response is the execution’s result as a list of list of Strings.

Examples

Map mapParams = new HashMap()
mapParams["Adapter ID"] = "groovy"

def resultSet = p6.sproc.execute("PROC1", mapParams)

println resultSet
p6.sproc.execute("procCreateFunction", true)
p6.sproc.execute("procCreateFunction", ["key":"value"], true)