Package com.basis.api.admin
Interface BBjAdminProcedure
- All Superinterfaces:
BBjAdminCommitPropertyWriter
,BBjAdminCommitWriter
,BBjAdminPropertyReader
,BBjAdminPropertyWriter
,Remote
,Serializable
- All Known Subinterfaces:
BBjAdminBBjProcedure
,BBjAdminLegacyProcedure
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Optional location of a config.bbx to use.static final String
Description of the SPROC.static final int
File format indicating plain text ASCII format for the source code file when callingwriteSourceFile(String, int)
.static final int
File format indicating BBj program format for the source code file when callingwriteSourceFile(String, int)
.static final String
Boolean indicating if the SPROC returns an SQL result set or not.static final String
Name of the SPROC.static final String
Program source code for the SPROC.static final String
SQL data type fromTypes
if the SPROC returns a value as the result.static final String
If it returns an SQL type, the precision or length of the return value.static final String
If it returns an SQL type, the scale if NUMERIC, or 0 if text.static final String
Location of the source code run by the SPROC when executed via an SQL CALL statement.static final String
True if the SPROC is a system SPROC. -
Method Summary
Modifier and TypeMethodDescriptionCreate a blank parameter.generateCodeTemplate
(String p_stringTemplate) Returns a source code template with boiler plate code for a working stored procedure.Used primarily by GUI applications like the Enterprise Manager to dynamically generate an admin UI.Get the list of the available parameters on the SPROC.Gets the source code for the procedure by reloading it from disk.int
Returns the source file's format.void
setDescriptiveProperties
(BBjAdminList<BBjAdminProperty> p_descriptiveProps) Used primarily by GUI applications like the Enterprise Manager to dynamically generate an admin UI.void
setParameters
(BBjAdminList<BBjAdminProcedureParameter> p_params) Set the list of available parameters for the SPROC.void
writeSourceFile
(String p_code, int p_fileFormat) Writes the specified source code to the SPROC's source code file in the specified file format.Methods inherited from interface com.basis.api.admin.BBjAdminCommitPropertyWriter
getChangedProperties, getClearedProperties, getOriginalProperties
Methods inherited from interface com.basis.api.admin.BBjAdminCommitWriter
commit, rollback
Methods inherited from interface com.basis.api.admin.BBjAdminPropertyReader
checkValueEqual, contains, contains, getBoolean, getDouble, getInt, getList, getLong, getProperties, getString, getType, getTypes, getValue
Methods inherited from interface com.basis.api.admin.BBjAdminPropertyWriter
addType, canAddNewProperties, canClear, clear, clearProperties, clearProperty, getReadOnly, hasChanged, isReadOnly, setBoolean, setDouble, setInt, setList, setLong, setProperties, setString, setValue
-
Field Details
-
NAME
Name of the SPROC.- See Also:
-
DESCRIPTION
Description of the SPROC.- See Also:
-
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
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
Boolean indicating if the SPROC returns an SQL result set or not.- See Also:
-
RETURN_TYPE
SQL data type fromTypes
if the SPROC returns a value as the result.- See Also:
-
RETURN_TYPE_PRECISION
If it returns an SQL type, the precision or length of the return value.- See Also:
-
RETURN_TYPE_SCALE
If it returns an SQL type, the scale if NUMERIC, or 0 if text.- See Also:
-
PROGRAM_CODE
Program source code for the SPROC. Read-only.- See Also:
-
FILE_FORMAT_ASCII
static final int FILE_FORMAT_ASCIIFile format indicating plain text ASCII format for the source code file when callingwriteSourceFile(String, int)
.- See Also:
-
FILE_FORMAT_BBJ
static final int FILE_FORMAT_BBJFile format indicating BBj program format for the source code file when callingwriteSourceFile(String, int)
.- See Also:
-
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
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
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
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
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
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
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. CallwriteSourceFile(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
-