Name

connection_vars_set — set all connection variables

Synopsis

connection_vars_set ( in var_array any );
 

Description

This function clears all connection variables for current session and sets new ones defined in the array passed as parameter.

Connection variables do not persist across sessions, one may maintain persistence of variables by storing them in a database table, as discussed in Session Variables -section.

Parameters

var_array

An array of even number of elements, containing name-value pairs. NULL, will cause all connection variables for current connection to be erased.

Examples

Example 24.53. Usage

  <?vsp
    connection_vars_set (vector ('ID', 12));
  ?>


Example 24.54. Setting and Retrieving Connection Variables

SQL>connection_vars_set(vector('v1', 'a', 'v2', 1));

Done. -- 0 msec.
SQL> select connection_vars();
callret
VARCHAR
___________________________________________________________________________

vector(0x004e419c,0x004e40c4,0x004dec9c,1)

1 Rows. -- 70 msec.
SQL>select aref(connection_vars(),0),
      aref(connection_vars(), 1),
      aref(connection_vars(), 2),
      aref(connection_vars(), 3);

callret                   callret                   callret                   callret
VARCHAR                   VARCHAR                   VARCHAR                   VARCHAR
_______________________________________________________________________________

v1                        a                         v2                        1

1 Rows. -- 80 msec.