Create a user-defined function by adding a SQL wrapper to a Java
static method.
- In the left pane of the Administration Console, expand , then select SQLJ Functions.
- Click the drop-down arrow and select New.
- On the Introduction screen, select the server, database, and owner of the new function.
- Enter the name of the function.
- Specify the external name, which identifies the Java method, class, and an optional package name.
- Select the datatype of the value returned by the function.
- On the SQL Properties screen, select:
- Null input – select to either return null if input is null, or to execute the function with null input.
- Modifies SQL data – indicate that the Java method invokes SQL operations and modifies SQL data in the database.
- Exportable – specify if this function may
be run on a remote server using the SAP ASE OmniConnect™ feature. Both the procedure and
the method it is built on must exist on the remote server.
- Deterministic option – include the
keywords deterministic or not deterministic for compatibility with the SQLJ standard.
However, SAP ASE does not make use of this option.
- On the SQL Editor screen, provide the SQLJ statements for the function. Ensure that all objects referenced by the function exist in the database.
- (Optional) Click Preview to see the SQL statements for your command.
- (Optional) Click Summary to verify your selected options.