Can be invoked from external procedures only.
Cannot be invoked from inside an SQL procedure body.
Function of ALTER PROCEDURE (External Form) Requests
ALTER PROCEDURE (External Form) enables you to control whether an existing external procedure can be run directly or indirectly as a separate process by the database. Run a function in direct execution mode only after is has been thoroughly debugged. When you create a new external procedure, it executes indirectly in protected execution mode by default (see CREATE PROCEDURE and REPLACE PROCEDURE (External Form)).
ALTER PROCEDURE (External Form) also allows you to recompile or relink an external procedure and redistribute it (and its associated JAR file if the external routine is written in Java) using the COMPILE option. This option is primarily intended for use by DBAs to recompile existing procedures that have been moved to another platform, system, or restored database.
ALTER PROCEDURE Invocation Restrictions (External Form)
Valid for external procedures only.
Not valid inside a procedure body.
AT TIME ZONE Option for External Procedures
When you create an external procedure, Vantage stores the current session time zone for the procedure with its definition to enable the SQL language elements in the procedure to run in a consistent time zone and produce consistent results. However, time or timestamp data passed as an input parameter to the procedure still use the runtime session time zone rather than the creation time zone for the procedure.
The AT TIME ZONE option enables you to reset the time zone for all of the SQL elements of external procedures when you recompile a procedure. Vantage then stores the newly specified time zone as the creation time zone for the procedure.
Specify AT TIME ZONE only after COMPILE [ONLY]. Otherwise, the system returns an error to the requestor.
Dictionary Updates and the COMPILE Option for Java Procedures
The following dictionary table updates occur as the result of an ALTER PROCEDURE COMPILE request for a Java external procedure:
- The corresponding row for a JAR in DBC.TVM is updated with a new version number. The Platform column in DBC.TVM is also updated.
- The corresponding row for a JAR in DBC.JARS is updated with a new version number.
- The corresponding row for the current database in DBC.Dbase is updated with an incremented JarLibRevision number.
Special Considerations for Java External Procedures
Java external procedures can only run in EXECUTE PROTECTED mode. If you specify EXECUTE NOT PROTECTED for a Java procedure, the request stops and returns an error message to the requestor.
For Java external procedures, the COMPILE option operates identically to external procedures written in C or C++ with the exception that the extension the JAR file references in the Java external procedure EXTERNAL NAME clause (see CREATE PROCEDURE and REPLACE PROCEDURE (External Form)) is redistributed to all affected nodes on the system. Redistribution is useful when a JAR file is missing on a given node.
The ONLY clause on the COMPILE option for external procedures written in Java generates preamble files, but does not redistribute their associated JAR file.