Interface BBjAdminProcedure

All Superinterfaces:
BBjAdminCommitPropertyWriter, BBjAdminCommitWriter, BBjAdminPropertyReader, BBjAdminPropertyWriter, Remote, Serializable
All Known Subinterfaces:
BBjAdminBBjProcedure, BBjAdminLegacyProcedure

public interface BBjAdminProcedure extends BBjAdminCommitPropertyWriter, Serializable
An individual stored procedure in a database. Stored procedures, or SPROCs, consist of BBj code that is executed by an SQL CALL statement. SPROCs can optionally have one or more parameters. Parameters also have direction designated as IN, OUT, or IN/OUT. SPROCs can optionally return an SQL result set, a standard value of one of the SQL data types, or nothing.
  • Field Details

    • NAME

      static final String NAME
      Name of the SPROC.
      See Also:
    • DESCRIPTION

      static final String DESCRIPTION
      Description of the SPROC.
      See Also:
    • SOURCE_LOCATION

      static final String SOURCE_LOCATION
      Location of the source code run by the SPROC when executed via an SQL CALL statement. You may use variables such as (DICTIONARY) or your own user defined properties. For example:
      (DICTIONARY)MY_SPROC.prc
      (COMPANY_ID)MY_SPROC.bbj

      Relative paths are recommended to make it easier to move the location of the database should that be necessary.
      See Also:
    • CONFIG_LOCATION

      static final String CONFIG_LOCATION
      Optional location of a config.bbx to use. Relative paths are recommended to make it easier to move the location of the database should that be necessary.
      See Also:
    • HAS_RESULT_SET

      static final String HAS_RESULT_SET
      Boolean indicating if the SPROC returns an SQL result set or not.
      See Also:
    • RETURN_TYPE

      static final String RETURN_TYPE
      SQL data type from Types if the SPROC returns a value as the result.
      See Also:
    • RETURN_TYPE_PRECISION

      static final String RETURN_TYPE_PRECISION
      If it returns an SQL type, the precision or length of the return value.
      See Also:
    • RETURN_TYPE_SCALE

      static final String RETURN_TYPE_SCALE
      If it returns an SQL type, the scale if NUMERIC, or 0 if text.
      See Also:
    • PROGRAM_CODE

      static final String PROGRAM_CODE
      Program source code for the SPROC. Read-only.
      See Also:
    • FILE_FORMAT_ASCII

      static final int FILE_FORMAT_ASCII
      File format indicating plain text ASCII format for the source code file when calling writeSourceFile(String, int).
      See Also:
    • FILE_FORMAT_BBJ

      static final int FILE_FORMAT_BBJ
      File format indicating BBj program format for the source code file when calling writeSourceFile(String, int).
      See Also:
    • SYSTEM

      static final String SYSTEM
      True if the SPROC is a system SPROC.
      See Also:
  • Method Details

    • getParameters

      Get the list of the available parameters on the SPROC.
      Returns:
      List of the parameters for this SPROC.
      Throws:
      BBjAdminException
    • setParameters

      void setParameters(BBjAdminList<BBjAdminProcedureParameter> p_params) throws BBjAdminException
      Set the list of available parameters for the SPROC.
      Parameters:
      p_params - List of BBjAdminProcedureParameter objects defining the parameters on the SPROC.
      Throws:
      BBjAdminException
    • createParameter

      BBjAdminProcedureParameter createParameter()
      Create a blank parameter.
      Returns:
      An empty BBjAdminProcedureParameter.
    • getSourceCode

      String getSourceCode() throws BBjAdminException
      Gets the source code for the procedure by reloading it from disk.
      Returns:
      A string containing the source code for the SPROC.
      Throws:
      BBjAdminException
    • getDescriptiveProperties

      BBjAdminList<BBjAdminProperty> getDescriptiveProperties() throws BBjAdminException
      Used primarily by GUI applications like the Enterprise Manager to dynamically generate an admin UI. To get property values for general purposes, you should call the getXXX() methods.
      Returns:
      BBjAdminList containing BBjAdminProperty objects for each available property.
      Throws:
      BBjAdminException
    • setDescriptiveProperties

      void setDescriptiveProperties(BBjAdminList<BBjAdminProperty> p_descriptiveProps) throws BBjAdminException
      Used primarily by GUI applications like the Enterprise Manager to dynamically generate an admin UI. To set property values for general purposes, you should call the setXXX() methods.
      Throws:
      BBjAdminException
    • writeSourceFile

      void writeSourceFile(String p_code, int p_fileFormat) throws BBjAdminException
      Writes the specified source code to the SPROC's source code file in the specified file format.
      Parameters:
      p_code - String containing the source code for the SPROC.
      p_fileFormat - One of the available types FILE_FORMAT_ASCII or FILE_FORMAT_BBJ.
      Throws:
      BBjAdminException
    • getSourceFileFormat

      int getSourceFileFormat() throws BBjAdminException
      Returns the source file's format.
      Returns:
      The source file's format which will be FILE_FORMAT_ASCII or FILE_FORMAT_BBJ.
      Throws:
      BBjAdminException
    • generateCodeTemplate

      String generateCodeTemplate(String p_stringTemplate) throws BBjAdminException
      Returns a source code template with boiler plate code for a working stored procedure. Contains the basic code already in place. It will generate the result set details from the specified string template if one is specified. Call writeSourceFile(String, int) to write the template to the SPROC's source file.
      Parameters:
      p_stringTemplate - String template to use to define the data returned by the SPROC if the SPROC returns an SQL result set.
      Returns:
      The generated boiler plate code.
      Throws:
      BBjAdminException