GET_CONNECTION

Use the GET_CONNECTION script function to read a specific value of a DB-type Connection object and have this value returned as code. A runtime error occurs when the system cannot find the specified object, if it is not a DB-type Connection object, or if the specified attribute is not valid.

Syntax

GET_CONNECTION (Object name, Attribute)

Parameters

  • GET_CONNECTION
    Reads information from a DB-type Connection object

  • Object name
    Name of a DB-type Connection object. For details, see Connection (CONN)
    Format: AE name, script literal, or script variable

  • Attribute
  • Value to be read from the object
    Format: AE name, script literal, or script variable
    Allowed values:
    • db.type
      Database type
      Possible return codes 
      • DB2
        for IBM DB2
      • EXASOL
        for Exasol
      • GENERICJDBC
        for the Generic JDBC
      • HANA
        for SAP HANA
      • INFORMIX
        for Informix
      • MYSQL
        for MySQL
      • MSSQL
        for Microsoft SQL Server
      • ORACLE
        for Oracle
      • ORACLE_OCI
        for Oracle OCI
      • POSTGRESQL
        for PostgreSQL
      • SYBASE
        for Sybase
    • db.server
      Name of the DB server
    • db.port
      Port number of the DB server
    • db.name
      Name of the database
    • DbUserid
      Database user
      Important! In case-sensitive databases, you must use the value exactly as shown here.
    • DbPassword
      Password of the DB user
    • Login
      Name of the alternative Login object

Return codes
The return code is value of the CONN object that you defined.

Examples

The following example retrieves the database type of the Connection object CONN.DB, and writes it to the activation report.

:SET &VAR#GET_CONNECTION(CONN.DB, db.type)
:&VAR#

This is how the related line appears in the activation report:

2022-07-30 12:45:21 - U0020408 MSSQL


See also: