A stored procedure can be called from within another stored procedure. The default limit for levels of nested procedures is 16. If the limit is exceeded, the transaction fails. The maximum nesting level is set by using the SQL.MaxNestedProcedures parameter. For details, see SQL section.
Like all SQL statements, a cursor should be prepared and executed as in the following example: