pcm_set_context() - cassiobj/PCM-Python_lib GitHub Wiki

Table of Contents

pcm_set_context Function

The pcm_set_context function is part of a Python extension for Oracle BRM. It allows changing the index of the connection array to the Oracle BRM Context Manager (CM), enabling up to 16 simultaneous connections with the CM by changing only the connection key.

Description

The pcm_set_context function changes the index of the connection array to the Oracle BRM Context Manager (CM), allowing up to 16 simultaneous connections with the CM by changing only the connection key.

Parameters

  • key: The index value to be set. It must be an integer value between 0 and 15, inclusive.

Return Value

The function returns an integer value representing the index value that was set.

In case of an error, the `error` exception is raised.

Usage

You can use the pcm_set_context function in your Python scripts to change the index of the connection array to the Oracle BRM Context Manager (CM). Here is an example code:

import PCMPy

# Change the index to 3
index = 3
try:
    result = PCMPy.pcm_set_context(index)
    if result is not None:
        print("Index changed to:", result)
    else:
        print("Failed to change index.")
except PCMPy.error as e:
    print("An error occurred:", str(e))
⚠️ **GitHub.com Fallback** ⚠️