The mi_sysname() function
The mi_sysname() function obtains the name of the default database server.
Syntax
char *mi_sysname(sysname)
char *sysname;
- sysname
- The name of the system or a NULL-valued pointer.
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
Yes | Yes |
Usage
- A string that specifies a database server name
The value in sysname must be defined in the server-definition file. Therefore, if the sysname value does not match an entry in this file, mi_sysname() returns a NULL-valued pointer.
On UNIX™ or Linux™, the sqlhosts file defines system names.
On Windows™, the Registry defines system names.
- A NULL-valued pointer
The mi_sysname() function returns the name of the current default database server. If a connection has not been established, there is no current default database server. The mi_sysname() function returns the string
"default"
to indicate that the current system is the default database server, which is initialized to the INFORMIXSERVER environment variable.
The mi_sysname() function initializes the DataBlade® API when it is the first DataBlade API function in a client LIBMI application or C UDR routine.
Return values
- A char pointer
- A pointer to the current system name.
- NULL
- The function was not successful.