Use the DbExecute system function to execute a stored procedure in a
specified database.
Before you run the workflow with the DbExecute system function, be sure
to define the database connection using vwtool. See dbconfig
in the online Help for vwtool.
To specify properties for the DbExecute system function
Place a system step on the workflow map where you want the database
function to execute.
In the Properties pane under Available Functions, select DbExecute,
then click the right arrow to move it to the Selected Functions column.
Double-click DbExecute in the Selected
Functions column to define the properties.
Enter the database name.
Enter the name of the stored procedure to execute.
Specify data fields that will provide parameter values. Use data fields
defined in Workflow Properties. Order the parameters as necessary to
match the order specified in the stored procedure.
The datatypes must match the types specified in
the stored procedure and may be of the following types:
Designer Param Type
Oracle Param Type
SQL Server Param Type
String
varchar
varchar
Integer
number
int
Boolean
number
bit
Float
number
float
Time
date
datetime
Parameters for a stored procedure cannot be arrays. For example, you
can pass in fifteen separate string parameters, but you cannot pass in
an array of fifteen strings as a single parameter. You can use a single
element in an array by specifying its index. For example, the syntax for
specifying the first element in an array is fieldname[1].
Handling parameters returned as null from stored procedures
If a string parameter is set to null by a stored procedure, the work
object data item will receive an emtpy string.
If a date/time, integer, or float parameter is set to null by a stored
procedure, an exception will be thrown. (there is no representation
of a null for these data types). In addition, an explanitory message
is logged.
If a boolean parameter is set to null, an exception will be thrown.
In addition, an explanitory message is logged.
Restrictions
Oracle
SQL Server
Maximum number of parameters in procedure
1024
1024
String parameter maximum characters
4000
255
Troubleshooting workflows using DbExecute
If a problem occurs in a running workflow at the DbExecute system function,
you can find information about the error in the system log or event log.
See FileNet event log files.