Use this statement to install 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
environment-name : PERL | PHP
update-mode : NEW | UPDATE
object-name The name by which the installed object will be identified within the database.
update-mode The update mode for the object. If the update mode is omitted, then NEW is assumed.
file-path The location on the server computer from where the object is being installed.
environment-name The name of the external environment in which the external object is run.
For more information about external environments, see Overview of external environments.
Must have DBA authority.
None
SQL/2003 Vendor extension.
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; |
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |