Statement Execution

From InterBase
Jump to: navigation, search

Go Up to Change Views


Once a statement is prepared, it is unnecessary to re-prepare the statement due to subscription activation or deactivation. A statement dynamically adjusts to the subscription environment of the transaction when it begins execution. Statement execution is also consistent in that once it begins, it returns change view result sets even if the subscription is deactivated before the full resultset has been fetched.

PREPARE Q; PREPARE Q
SET SUBSCRIPTION ... ACTIVE EXECUTE Q
EXECUTE Q FETCH Q
FETCH Q SET SUBSCRIPTION ... ACTIVE
SET SUBSCRIPTION ... INACTIVE FETCH Q
FETCH Q CLOSE Q
CLOSE Q

Subscribed table references in statement Q will return change view rows even after the subscription has been made inactive. The converse also holds in that a regular (non-change view) resultset will remain consistent when the FETCH of the resultset is interspersed with subscription activation.

NEXT: