REPLACE CLIB (Replace external C library file)
Function
In order to execute an external C stored routine on the machine that the UAP is executed on, REPLACE CLIB replaces an existing external C library file on the HiRDB server on which the external C stored routine is implemented.
Format
REPLACE CLIB {:embedded-variable|'character-string'} |
Operands
- {:embedded-variable|'character-string'}
Specifies the name of the external C library file to be replaced. 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
- Before you execute REPLACE CLIB, the computer you are using must be connected to a HiRDB server.
- Error codes are returned in SQLCODE.
- External C library files on other servers cannot be specified.
- Wildcards cannot be used.
- If an external C library file with the same name is already installed, it is overwritten.
- The external C library file will be installed on the HiRDB server if it is not already installed.
- REPLACE CLIB must be executed before the start of a transaction.
- The external C library file must be created on the same platform on which it is to be replaced.
- A C library file cannot be replaced during execution of a transaction.
Example
Specify and replace 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 REPLACE CLIB :filename ;