com.ibm.db.models.db2
Interface DB2Routine

All Superinterfaces:
commonj.sdo.DataObject, DB2AccessPlan, org.eclipse.emf.ecore.sdo.EDataObject, org.eclipse.emf.ecore.EModelElement, org.eclipse.emf.ecore.ENamedElement, org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.notify.Notifier, org.eclipse.wst.rdb.internal.models.sql.routines.Routine, java.io.Serializable, org.eclipse.wst.rdb.internal.models.sql.schema.SQLObject
All Known Subinterfaces:
DB2Function, DB2Method, DB2Procedure, DB2UserDefinedFunction, FederatedProcedure
All Known Implementing Classes:
DB2MethodImpl, DB2ProcedureImpl, DB2UserDefinedFunctionImpl, FederatedProcedureImpl

public interface DB2Routine
extends org.eclipse.wst.rdb.internal.models.sql.routines.Routine, DB2AccessPlan

A representation of the model object 'DB2 Routine'. SQL Reference for Cross-Platform Development - v1.1 http://www7b.software.ibm.com/dmdd/library/techarticle/0206sqlref/0206sqlref.html Routines (Chapter 1. Concepts 9): A routine is an executable SQL object. There are two types of routines. Functions: A function is a routine that can be invoked from within other SQL statements and returns a value, or a table. A function is created with the CREATE FUNCTION statement. Procedures: A procedure (sometimes called a stored procedure) is a routine that can be called to perform operations that can include both host language statements and SQL statements.

The following features are supported:

See Also:
DB2ModelPackage.getDB2Routine()

Field Summary
static int CLEAN
          Pseudo-enumerated value for changeState.
static int DIRTY
          Pseudo-enumerated value for changeState.
static int DIRTY_DDL
          Pseudo-enumerated value for changeState.
 
Method Summary
 int getChangeState()
          Returns the value of the 'Change State' attribute.
 java.lang.String getDebugId()
          Returns the value of the 'Debug Id' attribute.
 org.eclipse.emf.common.util.EList getExtendedOptions()
          Returns the value of the 'Extended Options' containment reference list.
 java.lang.String getFenced()
          Returns the value of the 'Fenced' attribute.
 java.lang.String getOrigParmSig()
          Returns the value of the 'Orig Parm Sig' attribute.
 java.lang.String getOrigSchemaName()
          Returns the value of the 'Orig Schema Name' attribute.
 java.lang.String getParmCcsid()
          Returns the value of the 'Parm Ccsid' attribute.
 java.lang.String getProgramType()
          Returns the value of the 'Program Type' attribute.
 org.eclipse.emf.common.util.EList getRoutineExtensions()
          Returns the value of the 'Routine Extensions' reference list.
 java.lang.String getSpecialRegister()
          Returns the value of the 'Special Register' attribute.
 java.lang.String getThreadsafe()
          Returns the value of the 'Threadsafe' attribute.
 boolean isDbInfo()
          Returns the value of the 'Db Info' attribute.
 boolean isFederated()
          Returns the value of the 'Federated' attribute.
 boolean isImplicitSchema()
          Returns the value of the 'Implicit Schema' attribute.
 void setChangeState(int value)
          Sets the value of the 'Change State' attribute.
 void setDbInfo(boolean value)
          Sets the value of the 'Db Info' attribute.
 void setDebugId(java.lang.String value)
          Sets the value of the 'Debug Id' attribute.
 void setFederated(boolean value)
          Sets the value of the 'Federated' attribute.
 void setFenced(java.lang.String value)
          Sets the value of the 'Fenced' attribute.
 void setImplicitSchema(boolean value)
          Sets the value of the 'Implicit Schema' attribute.
 void setOrigParmSig(java.lang.String value)
          Sets the value of the 'Orig Parm Sig' attribute.
 void setOrigSchemaName(java.lang.String value)
          Sets the value of the 'Orig Schema Name' attribute.
 void setParmCcsid(java.lang.String value)
          Sets the value of the 'Parm Ccsid' attribute.
 void setProgramType(java.lang.String value)
          Sets the value of the 'Program Type' attribute.
 void setSpecialRegister(java.lang.String value)
          Sets the value of the 'Special Register' attribute.
 void setThreadsafe(java.lang.String value)
          Sets the value of the 'Threadsafe' attribute.
 
Methods inherited from interface org.eclipse.wst.rdb.internal.models.sql.routines.Routine
getAuthorizationID, getCreationTS, getExternalName, getInputParameters, getLanguage, getLastAlteredTS, getOutputParameters, getParameters, getParameterStyle, getSchema, getSecurity, getSource, getSpecificName, getSqlDataAccess, isDeterministic, setAuthorizationID, setCreationTS, setDeterministic, setExternalName, setLanguage, setLastAlteredTS, setParameterStyle, setSchema, setSecurity, setSource, setSpecificName, setSqlDataAccess
 
Methods inherited from interface org.eclipse.wst.rdb.internal.models.sql.schema.SQLObject
addEAnnotation, addEAnnotationDetail, getComments, getDependencies, getDescription, getEAnnotation, getEAnnotationDetail, getLabel, getPrivileges, removeEAnnotationDetail, setAnnotationDetail, setDescription, setLabel
 
Methods inherited from interface org.eclipse.emf.ecore.sdo.EDataObject
getInstanceProperties
 
Methods inherited from interface commonj.sdo.DataObject
createDataObject, createDataObject, createDataObject, createDataObject, createDataObject, createDataObject, delete, get, get, get, getBigDecimal, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getBytes, getBytes, getBytes, getChar, getChar, getChar, getContainer, getContainmentProperty, getDataGraph, getDataObject, getDataObject, getDataObject, getDate, getDate, getDate, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInt, getList, getList, getList, getLong, getLong, getLong, getSequence, getSequence, getSequence, getShort, getShort, getShort, getString, getString, getString, getType, isSet, isSet, isSet, set, set, set, setBigDecimal, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBigInteger, setBoolean, setBoolean, setBoolean, setByte, setByte, setByte, setBytes, setBytes, setBytes, setChar, setChar, setChar, setDataObject, setDataObject, setDataObject, setDate, setDate, setDate, setDouble, setDouble, setDouble, setFloat, setFloat, setFloat, setInt, setInt, setInt, setList, setList, setList, setLong, setLong, setLong, setShort, setShort, setShort, setString, setString, setString, unset, unset, unset
 
Methods inherited from interface org.eclipse.emf.ecore.ENamedElement
getName, setName
 
Methods inherited from interface org.eclipse.emf.ecore.EModelElement
getEAnnotations
 
Methods inherited from interface org.eclipse.wst.rdb.internal.models.sql.schema.SQLObject
addEAnnotation, addEAnnotationDetail, getComments, getDependencies, getDescription, getEAnnotation, getEAnnotationDetail, getLabel, getPrivileges, removeEAnnotationDetail, setAnnotationDetail, setDescription, setLabel
 
Methods inherited from interface org.eclipse.emf.ecore.sdo.EDataObject
getInstanceProperties
 
Methods inherited from interface commonj.sdo.DataObject
createDataObject, createDataObject, createDataObject, createDataObject, createDataObject, createDataObject, delete, get, get, get, getBigDecimal, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getBytes, getBytes, getBytes, getChar, getChar, getChar, getContainer, getContainmentProperty, getDataGraph, getDataObject, getDataObject, getDataObject, getDate, getDate, getDate, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInt, getList, getList, getList, getLong, getLong, getLong, getSequence, getSequence, getSequence, getShort, getShort, getShort, getString, getString, getString, getType, isSet, isSet, isSet, set, set, set, setBigDecimal, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBigInteger, setBoolean, setBoolean, setBoolean, setByte, setByte, setByte, setBytes, setBytes, setBytes, setChar, setChar, setChar, setDataObject, setDataObject, setDataObject, setDate, setDate, setDate, setDouble, setDouble, setDouble, setFloat, setFloat, setFloat, setInt, setInt, setInt, setList, setList, setList, setLong, setLong, setLong, setShort, setShort, setShort, setString, setString, setString, unset, unset, unset
 
Methods inherited from interface org.eclipse.emf.ecore.ENamedElement
getName, setName
 
Methods inherited from interface org.eclipse.emf.ecore.EModelElement
getEAnnotations
 

Field Detail

CLEAN

static final int CLEAN
Pseudo-enumerated value for changeState. CLEAN means the routine hasn't changed since it was deployed to the server.

See Also:
setChangeState(int);, Constant Field Values

DIRTY_DDL

static final int DIRTY_DDL
Pseudo-enumerated value for changeState. DIRTY_DDL means the routine's DDL has changed since the last time it was deployed to the server.

See Also:
setChangeState(int);, Constant Field Values

DIRTY

static final int DIRTY
Pseudo-enumerated value for changeState. DIRTY means the routine's source has changed since the last time it was deployed to the server.

See Also:
setChangeState(int);, Constant Field Values
Method Detail

getFenced

java.lang.String getFenced()
Returns the value of the 'Fenced' attribute. From the DB2 SQL Reference for Cross-Platform Development v1.1 Specifies that the external function or procedure runs in an environment that is isolated from the database manager environment. From the v8.1 UDB documentation for external UDFs and stored procedures: This clause specifies whether the stored procedure is considered "safe" to run in the database manager operating environment's process or address space (NOT FENCED), or not (FENCED). If a stored procedure is registered as FENCED, the database manager protects its internal resources (for example, data buffers) from access by the procedure. All procedures have the option of running as FENCED or NOT FENCED. In general, a procedure running as FENCED will not perform as well as a similar one running as NOT FENCED. CAUTION: Use of NOT FENCED for procedures that have not been adequately checked out can compromise the integrity of DB2. DB2 takes some precautions against many of the common types of inadvertent failures that could occur, but cannot guarantee complete integrity when NOT FENCED stored procedures are used. Either SYSADM authority, DBADM authority, or a special authority (CREATE_NOT_FENCED) is required to register a stored procedure as NOT FENCED. Only FENCED can be specified for a stored procedure with LANGUAGE OLE or NOT THREADSAFE. To create a not-fenced stored procedure, the privileges held by the authorization ID of the statement must also include at least one of the following: - CREATE_NOT_FENCED_ROUTINE authority on the database - SYSADM or DBADM authority. To create a fenced stored procedure, no additional authorities or privileges are required. If the authorization ID has insufficient authority to perform the operation, an error (SQLSTATE 42502) is raised. As of Sept 2003, there isn't a Fenced attribute for 390. There is one supported for as400 is done so for compatibility purposes.

Returns:
the value of the 'Fenced' attribute.
See Also:
setFenced(String), DB2ModelPackage.getDB2Routine_Fenced()

setFenced

void setFenced(java.lang.String value)
Sets the value of the 'Fenced' attribute.

Parameters:
value - the new value of the 'Fenced' attribute.
See Also:
getFenced()

getThreadsafe

java.lang.String getThreadsafe()
Returns the value of the 'Threadsafe' attribute. From the v8.1 UDB documentation for external UDFs and stored procedures: Specifies whether the procedure is considered safe to run in the same process as other routines (THREADSAFE), or not (NOT THREADSAFE). If the procedure is defined with LANGUAGE other than OLE: - If the procedure is defined as THREADSAFE, the database manager can invoke the procedure in the same process as other routines. In general, to be threadsafe, a procedure should not use any global or static data areas. Most programming references include a discussion of writing threadsafe routines. Both FENCED and NOT FENCED procedures can be THREADSAFE. - If the procedure is defined as NOT THREADSAFE, the database manager will never invoke the procedure in the same process as another routine. For FENCED procedures, THREADSAFE is the default if the LANGUAGE is JAVA. For all other languages, NOT THREADSAFE is the default. If the procedure is defined with LANGUAGE OLE, THREADSAFE may not be specified (SQLSTATE 42613). For NOT FENCED procedures, THREADSAFE is the default. NOT THREADSAFE cannot be specified (SQLSTATE 42613). As of Sept 2003, only for LUW

Returns:
the value of the 'Threadsafe' attribute.
See Also:
setThreadsafe(String), DB2ModelPackage.getDB2Routine_Threadsafe()

setThreadsafe

void setThreadsafe(java.lang.String value)
Sets the value of the 'Threadsafe' attribute.

Parameters:
value - the new value of the 'Threadsafe' attribute.
See Also:
getThreadsafe()

isDbInfo

boolean isDbInfo()
Returns the value of the 'Db Info' attribute.

From the DB2 SQL Reference for Cross-Platform Development v1.1 http://www7b.software.ibm.com/dmdd/library/techarticle/0206sqlref/0206sqlref.html CREATE PROCEDURE (External): NO DBINFO or DBINFO Specifies whether additional status information is passed to the procedure when it is invoked. The default is NO DBINFO. NO DBINFO Additional information is not passed. DBINFO An additional argument is passed when the procedure is invoked. The argument is a structure that contains information such as the name of the current server, the application run-time authorization ID and identification of the version and release of the database manager that invoked the procedure. See "Database information in external routines (DBINFO)" on page 708 for further details. DBINFO can be specified only if PARAMETER STYLE DB2SQL is specified. Parameter passing for external functions or procedures written in C or COBOL This input argument is set by the database manager before invoking the program. It is only present if the CREATE FUNCTION statement for the routine specifies the DBINFO keyword. The argument is a structure whose definition is described in "Database information in external routines (DBINFO)" on page 708. The dbinfo argument is input only and any changes to the argument value made by the program are ignored by the database manager upon return from the program. From the v8.1 UDB documentation for external UDFs and stored procedures: Specifies whether specific information known by DB2 is passed to the stored procedure when it is invoked as an additional invocation-time argument (DBINFO) or not (NO DBINFO). NO DBINFO is the default. DBINFO is not supported for LANGUAGE OLE (SQLSTATE 42613). It is also not supported for PARAMETER STYLE JAVA or DB2GENERAL. If DBINFO is specified, a structure containing the following information is passed to the stored procedure: - Data base name - the name of the currently connected database. - Application ID - unique application ID which is established for each connection to the database. - Application Authorization ID - the application run-time authorization ID. - Code page - identifies the database code page. - Database version/release - identifies the version, release and modification level of the database server invoking the stored procedure. - Platform - contains the server's platform type. The DBINFO structure is common for all external routines and contains additional fields that are not relevant to procedures. CREATE PROCEDURE (External) From the os390 v7 SQL reference: Specifies whether specific information known by DB2 is passed to the stored procedure when it is invoked. NO DBINFO Additional information is not passed. NO DBINFO is the default. DBINFO An additional argument is passed when the stored procedure is invoked. The argument is a structure that contains information such as the application run-time authorization ID, the schema name, the name of a table or column that the procedure might be inserting into or updating, and identification of the database server that invoked the procedure. For details about the argument and its structure, see DB2 Application Programming and SQL Guide. DBINFO can be specified only if PARAMETER STYLE DB2SQL is specified. From the as400 SQL v5r1 SQL reference: DBINFO Indicates that the database manager should pass a structure containing status information to the function. Table 24 in the SQL reference contains a description of the DBINFO structure. Detailed information about the DBINFO structure can be found in include file SQLUDF in QSYSINC.H. DBINFO is only allowed with PARAMETER STYLE DB2SQL.

Returns:
the value of the 'Db Info' attribute.
See Also:
setDbInfo(boolean), DB2ModelPackage.getDB2Routine_DbInfo()

setDbInfo

void setDbInfo(boolean value)
Sets the value of the 'Db Info' attribute.

Parameters:
value - the new value of the 'Db Info' attribute.
See Also:
isDbInfo()

isImplicitSchema

boolean isImplicitSchema()
Returns the value of the 'Implicit Schema' attribute.

From the DB2 SQL Reference for Cross-Platform Development v1.1 http://www7b.software.ibm.com/dmdd/library/techarticle/0206sqlref/0206sqlref.html The routine name is implicitly or explicitly qualified with a schema name. If the routine is created without a schema, then it is created with an implicit schema. The implicit schema name is determined as follows: - For distinct type names, the database manager searches the SQL path and selects the first schema in the SQL path such that the data type exists in the schema. - For procedure names, the database manager searches the SQL path and selects the first schema in the SQL path such that the schema contains a procedure with the same name and the same number of parameters. - For function names, the database manager uses the SQL path in conjunction with function resolution, as described under "Function resolution" on page 94.

Returns:
the value of the 'Implicit Schema' attribute.
See Also:
setImplicitSchema(boolean), DB2ModelPackage.getDB2Routine_ImplicitSchema()

setImplicitSchema

void setImplicitSchema(boolean value)
Sets the value of the 'Implicit Schema' attribute.

Parameters:
value - the new value of the 'Implicit Schema' attribute.
See Also:
isImplicitSchema()

isFederated

boolean isFederated()
Returns the value of the 'Federated' attribute.

From UDB v8.1 SQL Reference Volume 2 FEDERATED or NOT FEDERATED This optional clause specifies whether or not federated objects can be used. If NOT FEDERATED is specified, federated objects cannot be used in any SQL statement in the function or procedure . Using a federated object will result in an error (SQLSTATE 55047).

Returns:
the value of the 'Federated' attribute.
See Also:
setFederated(boolean), DB2ModelPackage.getDB2Routine_Federated()

setFederated

void setFederated(boolean value)
Sets the value of the 'Federated' attribute.

Parameters:
value - the new value of the 'Federated' attribute.
See Also:
isFederated()

getParmCcsid

java.lang.String getParmCcsid()
Returns the value of the 'Parm Ccsid' attribute.

From the DB2 SQL Reference for Cross-Platform Development v1.1 http://www7b.software.ibm.com/dmdd/library/techarticle/0206sqlref/0206sqlref.html The meaning of the environment Coded Character Set Identifier (CCSID) depends on the application server where the routine is executed. - On DB2 UDB for z/OS and OS/390, the environment CCSIDs are the CCSIDs for the table accessed in the containing SQL statement. - On DB2 UDB for iSeries, the environment CCSIDs are the CCSIDs associated with the job. - On DB2 UDB for LUW, the environment CCSIDs are the CCSIDs for the relational database. DB2 Universal Database for OS/390 and z/OS v7 SQL Ref: Every string used in an SQL operation has a CCSID. The CCSID identifies the manner in which the characters in the string are encoded. Strings can be encoded in ASCII, EBCDIC, or Unicode. Many of the times, the default CCSID is used

Returns:
the value of the 'Parm Ccsid' attribute.
See Also:
setParmCcsid(String), DB2ModelPackage.getDB2Routine_ParmCcsid()

setParmCcsid

void setParmCcsid(java.lang.String value)
Sets the value of the 'Parm Ccsid' attribute.

Parameters:
value - the new value of the 'Parm Ccsid' attribute.
See Also:
getParmCcsid()

getSpecialRegister

java.lang.String getSpecialRegister()
Returns the value of the 'Special Register' attribute.

For UDB, in BNF diagrams above the line, INHERIT SPECIAL REGISTERS is the default. For zSeries, v7+ there is both INHERIT SPECIAL REGISTERS Indicates that the values of special registers are inherited according to the rules listed in the table for characteristics of special registers in a user-defined function or stored procedure in Table 19 on page 92. DEFAULT SPECIAL REGISTERS Indicates that special registers are initialized to the default values, as indicated by the rules in the table for characteristics of special registers in a user-defined function or stored procedure in Table 19 on page 92.

Returns:
the value of the 'Special Register' attribute.
See Also:
setSpecialRegister(String), DB2ModelPackage.getDB2Routine_SpecialRegister()

setSpecialRegister

void setSpecialRegister(java.lang.String value)
Sets the value of the 'Special Register' attribute.

Parameters:
value - the new value of the 'Special Register' attribute.
See Also:
getSpecialRegister()

getChangeState

int getChangeState()
Returns the value of the 'Change State' attribute. The default value is "0". This replaces the "dirty" and "dirtyDDL" attributes in the WSAD v6 and previous SQL models. changeState is integer for to indicate DIRTY source, or just dirty DDL (where an external routine doesn't need to be recompiled, just dropped and registered). Rather than use an enumerated type which is not extendable in EMF, this will have a pseudo-enumerated type so that the db2 routines can be extended to hold more state information than just DIRTY (2) and DIRTY_DDL (1), and CLEAN (0). CLEAN will be the default as the initial value is set to 0.

Returns:
the value of the 'Change State' attribute.
See Also:
setChangeState(int), DB2ModelPackage.getDB2Routine_ChangeState()

setChangeState

void setChangeState(int value)
Sets the value of the 'Change State' attribute.

Parameters:
value - the new value of the 'Change State' attribute.
See Also:
getChangeState()

getDebugId

java.lang.String getDebugId()
Returns the value of the 'Debug Id' attribute. Special ID to uniquely define the registered, built-for-debug routine at the server.

Returns:
the value of the 'Debug Id' attribute.
See Also:
setDebugId(String), DB2ModelPackage.getDB2Routine_DebugId()

setDebugId

void setDebugId(java.lang.String value)
Sets the value of the 'Debug Id' attribute.

Parameters:
value - the new value of the 'Debug Id' attribute.
See Also:
getDebugId()

getProgramType

java.lang.String getProgramType()
Returns the value of the 'Program Type' attribute. For OS/390 v6 and v7, both UDFs and SPs

From DB2 OS390 v7 SQL Reference:

SUB
The stored procedure runs as a subroutine.
MAIN
The stored procedure runs as a main routine.

The stored procedure runs as a main routine. The default for PROGRAM TYPE depends on the value of special register CURRENT RULES. The default is:

Returns:
the value of the 'Program Type' attribute.
See Also:
setProgramType(String), DB2ModelPackage.getDB2Routine_ProgramType()

setProgramType

void setProgramType(java.lang.String value)
Sets the value of the 'Program Type' attribute.

Parameters:
value - the new value of the 'Program Type' attribute.
See Also:
getProgramType()

getOrigSchemaName

java.lang.String getOrigSchemaName()
Returns the value of the 'Orig Schema Name' attribute. For rollback purposes, we need to track the original Schema name used to create this routine.

Returns:
the value of the 'Orig Schema Name' attribute.
See Also:
setOrigSchemaName(String), DB2ModelPackage.getDB2Routine_OrigSchemaName()

setOrigSchemaName

void setOrigSchemaName(java.lang.String value)
Sets the value of the 'Orig Schema Name' attribute.

Parameters:
value - the new value of the 'Orig Schema Name' attribute.
See Also:
getOrigSchemaName()

getOrigParmSig

java.lang.String getOrigParmSig()
Returns the value of the 'Orig Parm Sig' attribute. For rollback purposes, we need to track the original parameter signature of this routine.

Returns:
the value of the 'Orig Parm Sig' attribute.
See Also:
setOrigParmSig(String), DB2ModelPackage.getDB2Routine_OrigParmSig()

setOrigParmSig

void setOrigParmSig(java.lang.String value)
Sets the value of the 'Orig Parm Sig' attribute.

Parameters:
value - the new value of the 'Orig Parm Sig' attribute.
See Also:
getOrigParmSig()

getExtendedOptions

org.eclipse.emf.common.util.EList getExtendedOptions()
Returns the value of the 'Extended Options' containment reference list. The list contents are of type DB2ExtendedOptions.

Returns:
the value of the 'Extended Options' containment reference list.
See Also:
DB2ModelPackage.getDB2Routine_ExtendedOptions()

getRoutineExtensions

org.eclipse.emf.common.util.EList getRoutineExtensions()
Returns the value of the 'Routine Extensions' reference list. The list contents are of type DB2RoutineExtension.

Extensions for application specific needs. The DB2Model has no dependencies on whoever implements DB2RoutineExtension

Returns:
the value of the 'Routine Extensions' reference list.
See Also:
DB2ModelPackage.getDB2Routine_RoutineExtensions()