Scalable Database Server, HiRDB Version 8 UAP Development Guide

[Contents][Index][Back][Next]

11.1.4 Current SQL connection and database access

Each SQL statement for accessing a database is executed using an SQL connection called the current SQL connection. Even if multiple SQL connections have been generated, there is only one current SQL connection at a time. The connection-destination RD-node for the current SQL connection is called the current RD-node.

At any time, any of the existing SQL connections (other than the current SQL connection) can be made into the current SQL connection by issuing the SET CONNECTION statement.

Table 11-2 shows the times at which the current SQL connection is set and the current RD-node after the setting.

Table 11-2 Current SQL connection setting

Setting time Current RD-node
CONNECT statement without RD-node specification is executed Default RD-node
CONNECT statement with RD-node specification is executed Specified distributed RD-node
SET CONNECTION statement with distributed RD-node specification is executed Specified distributed RD-node
SET CONNECTION statement with DEFAULT specified is executed Default RD-node
DISCONNECT statement with current RD-node and RD-node specifications is executed Default RD-node

Table 11-3 shows the relationship between the current SQL connection and the range of databases that can be accessed.

Table 11-3 Current SQL connection and range of databases that can be accessed

Current SQL connection Range of databases that can be accessed
Default SQL connection
  • Databases at the current RD-node (= default RD-node)
  • Databases at all distributed RD-nodes that can be connected to the default RD-node*
SQL connection to distributed RDnode
  • Databases at the current RD-node (= single distributed RD-node)

* For details about how to use the default SQL connection for accessing the database of a distributed RD-node, see 11.2.2 Using the default SQL connection.