INSTALL CLIB (Install external C library file)

Function

In order to execute an external C stored routine on the machine that the UAP is executed on, INSTALL CLIB installs a new external C library file on the HiRDB server on which the external C stored routine is implemented.

Format

INSTALL CLIB {:embedded-variable|'character-string'}

Operands

Specifies the name of the external C library file to be installed. Specify an absolute path name or a relative path name for the name of the external C library file.

:embedded-variable
Specifies the name of the external C library file as a VARCHAR type embedded variable.
Character sets other than the default character set cannot be specified.
'character-string'
Specifies the name of the external C library file as a character string literal.

Common rules

  1. Before you execute INSTALL CLIB, the computer you are using must be connected to a HiRDB server.
  2. Error codes are returned in SQLCODE.
  3. External C library files on other servers cannot be specified.
  4. Wildcards cannot be used.
  5. If an external C library file with the same name is already installed, executing INSTALL CLIB results in an error and the existing external C library file is not overwritten.
  6. INSTALL CLIB must be executed before the start of a transaction.
  7. The external C library file must be created on the same platform on which it is to be installed.

Example

Specify and install an external C library file (c:\work\sampleproc.dll) using an embedded variable.

EXEC SQL BEGIN DECLARE SECTION ;
struct {
   short  len ;
   char   str[256] ;
} filename ;
EXEC SQL END DECLARE SECTION ;
EXEC SQL CONNECT ;
strcpy(filename.str,"c:\\work\\sampleproc.dll") ;
filename.len = strlen(filename.str) ;
EXEC SQL INSTALL CLIB :filename ;