db_get_property function

Prototype
unsigned int db_get_property(
SQLCA * sqlca,
a_db_property property,
char * value_buffer,
int value_buffer_size );
Description

This function is used to obtain information about the database interface or the server to which you are connected.

The arguments are as follows:

  • a_db_property   The property requested, either DB_PROP_CLIENT_CHARSET, DB_PROP_SERVER_ADDRESS, or DB_PROP_DBLIB_VERSION.

  • value_buffer   This argument is filled with the property value as a null-terminated string.

  • value_buffer_size   The maximum length of the string value_buffer, including the terminating null character.

The following properties are supported:

  • DB_PROP_CLIENT_CHARSET   This property value gets the client character set (for example, "windows-1252").

  • DB_PROP_SERVER_ADDRESS   This property value gets the current connection's server network address as a printable string. The shared memory protocol always returns the empty string for the address. The TCP/IP protocol returns non-empty string addresses.

  • DB_PROP_DBLIB_VERSION   This property value gets the database interface library's version (for example, "11.0.0.1297").

Returns 1 if successful, 0 otherwise.