How to prevent SET CHAINED OFF from intermittent failure when using packaged query against a data source in TIBCO Data Virtualization?

How to prevent SET CHAINED OFF from intermittent failure when using packaged query against a data source in TIBCO Data Virtualization?

book

Article ID: KB0076947

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization All supported versions

Description

In TIBCO Data Virtualization, when executing a packaged query (like the one below) against a data source may fail intermittently (every few executions) with below error:

---------------------------
...
SET CHAINED OFF
EXEC {procedure}
...
---------------------------

Error:
===============
Unable to retrieve result from data source "{ds_name}" during query execution.
    Failed query: "SET CHAINED OFF
EXEC {procedure} [data-3923000]
Cause: SET CHAINED command not allowed within multi-statement transaction.

===============

Issue/Introduction

How to prevent SET CHAINED OFF from intermittent failure when using packaged query against a data source in TIBCO Data Virtualization?

Resolution

Perform a 'COMMIT' before the 'SET CHAINED OFF' so the set command takes in-effect from the first execution.

Example:
-------------------------- 
...
COMMIT
SET CHAINED OFF
EXEC {procedure}
...
--------------------------