Installs an object that can be run in an external environment.
INSTALL EXTERNAL OBJECT object-name [ update-mode ] FROM { FILE file-path | VALUE expression } ENVIRONMENT environment-name [ AS USER user-name ]
environment-name : PERL | PHP | JS
update-mode : NEW | UPDATE
The name by which the installed object will be identified within the database.
The update mode for the object. If the update mode is omitted, then NEW is assumed.
The location on the server computer from where the object is being installed.
The name of the external environment in which the external object is run.
Specifies the owner of the object.
None.
You must have the MANAGE ANY EXTERNAL OBJECT system privilege.
None
Not in the standard.
In this example, you install a Perl script that is located in a file into the database.
INSTALL EXTERNAL OBJECT 'PerlScript' NEW FROM FILE 'perlfile.pl' ENVIRONMENT PERL;
Perl code also can be built and installed from an expression, as follows:
INSTALL EXTERNAL OBJECT 'PerlConsoleExample' NEW FROM VALUE 'sub WriteToServerConsole { print $sa_output_handle $_[0]; }' ENVIRONMENT PERL;
Perl code also can be built and installed from a variable, as follows:
CREATE VARIABLE PerlVariable LONG VARCHAR; SET PerlVariable = 'sub WriteToServerConsole { print $sa_output_handle $_[0]; }'; INSTALL EXTERNAL OBJECT 'PerlConsoleExample' NEW FROM VALUE PerlVariable ENVIRONMENT PERL;