%SSC_GETDBID

Get database ID

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
value = %SSC_GETDBID(dbchannel, dbid)

value

This function returns SSQL_NORMAL (success) or SSQL_FAILURE (failure). (i)

dbchannel

An internal database channel previously initialized using %SSC_INIT. (n)

dbid

The returned database ID. (n)

%SSC_GETDBID gets the database ID for the specified database channel. The following table lists the possible database IDs.

Database IDs

Database system ID

ID#

Database

SSQL_DID_NONE

N/A

Not connected (or released by %SSC_RELEASE)

SSQL_DID_ORACLE

0

Oracle

SSQL_DID_RDB

1

Oracle Rdba

SSQL_DID_SDAPI

4

Synergy Database

SSQL_DID_DB2

7

IBM DB2a

SSQL_DID_OLEDB

8

OLE DB-complianta

SSQL_DID_ODBC

11

ODBC-complianta

SSQL_DID_SQLSRV

12

SQL Server

SSQL_DID_MYSQL

14

MySQL

a. Support for these databases may require assistance from Synergex Professional Services and additional support fees. Contact your Synergex account manager for details.

The following example demonstrates how to use %SSC_GETDBID:

user = "sa/manager"              ;Default database connection
if (%ssc_connect(dbchn, user))
  goto err_exit
if (%ssc_getdbid(dbchn, dbid))   ;Get the database ID
  goto err_exit
if (dbid.eq.SSQL_DID_SQLSRV)
  if (%ssc_cmd(dbchn, cur1, SSQL_USEDB, "Synergex"))
    goto err_exit                ;Cur1 ignored