Creating a SQLJ Function

Create a SQLJ function using the Sybase Control Center Administration Console.

  1. In the left pane of the Administration Console, expand ASE Servers > Compiled Objects > Functions, then select SQLJ Functions.
  2. Select New.
    You see the Create SQLJ Function wizard.
  3. On the Introduction screen, select the server, database, and owner of the new function.
  4. Enter the name of the function.
  5. Specify the external name, which identifies the Java method, class, and an optional package name.
  6. Select the datatype of the value returned by the function.
  7. 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 Adaptive Server 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, Adaptive Server does not make use of this option.
  8. On the SQL Editor screen, provide the SQLJ statements for the function. Ensure that all objects referenced by the function exist in the database.
  9. (Optional) Click Preview to see the SQL statements for your command.
  10. (Optional) Click Summary to verify your selected options.