DBA Data[Home] [Help]

PACKAGE: APPS.FND_OAM_DSCRAM_PLSQLS_PKG

Source


1 PACKAGE FND_OAM_DSCRAM_PLSQLS_PKG AUTHID CURRENT_USER as
2 /* $Header: AFOAMDSPLSS.pls 120.0 2005/09/27 12:45 ilawler noship $ */
3 
4    ------------
5    -- Constants
6    ------------
7 
8    ---------------------------------
9    -- Public Procedures/Functions --
10    ---------------------------------
11 
12    -- Accessor function to obtain plsql-related state
13    -- Invariants:
14    --   State must have been initialized by a prior call to one of the execute_plsql* procedures
15    -- Parameters:
16    --   None
17    -- Returns:
18    --   The numerical ID of the currently executing PLSQL
19    -- Exceptions:
20    --   If a prior call to execute_plsql wasn't executed, a NO_DATA_FOUND exception is thrown.
21    FUNCTION GET_CURRENT_PLSQL_ID
22       RETURN NUMBER;
23 
24    -- This API is used to get the list of un-finished PLSQLs for a given unit id.
25    -- Invariants:
26    --   None.  Low enough level that there's no safety harness to higher state.
27    -- Parameters:
28    --   p_unit_id         DSCRAM_UNITS.UNIT_ID of the parent unit, not obtained from state to facilitate composite unit types
29    --   x_work_queue:     Work queue containing plsqls found in the proper scheduling order
30    --   x_return_status:  FND_API-compliant return status
31    --   x_return_msg:     Message explaining non-success return statuses
32    -- Return Statuses:
33    --   G_RET_STS_SUCCESS     Success
34    --   G_RET_STS_ERROR       Expected, possible error found. See return_msg.
35    --   G_RET_STS_ERROR_UNEXP Unexpected Error found.  See return_msg.
36    PROCEDURE FETCH_PLSQL_IDS(p_unit_id          IN              NUMBER,
37                              x_work_queue       OUT NOCOPY      FND_OAM_DSCRAM_UNITS_PKG.ordered_work_queue_type,
38                              x_return_status    OUT NOCOPY      VARCHAR2,
39                              x_return_msg       OUT NOCOPY      VARCHAR2);
40 
41    -- API used when processing a set of PLSQLs on a range of rowids.  No autonomous transaction
42    -- and no calls to AD complete procedures to avoid any implicit commits that would make it
43    -- harder to use this in a composite unit.
44    -- Invariants:
45    --   None
46    -- Parameters:
47    --   p_plsql_ids:          DSCRAM_PLSQLS.PLSQL_ID of PLSQLs to execute
48    --   px_arg_context:       Argument context for execution
49    --   p_rowid_lbound:       Lower Bound ROWID to process (first arg of 'between')
50    --   p_rowid_ubound:       Upper Bound ROWID to process (second arg of 'between')
51    --   x_return_status:      FND_API-compliant return status
52    --   x_return_msg:         Message explaining non-success return statuses
53    -- Return Statuses:
54    --   G_RET_STS_SUCCESS     Success
55    --   G_RET_STS_ERROR       Expected, possible error found. See return_msg.
56    --   G_RET_STS_ERROR_UNEXP Unexpected Error found.  See return_msg.
57    PROCEDURE EXECUTE_PLSQL_ON_RANGE(p_plsql_id          IN NUMBER,
58                                     px_arg_context      IN OUT NOCOPY FND_OAM_DSCRAM_ARGS_PKG.arg_context,
59                                     p_rowid_lbound      IN ROWID,
60                                     p_rowid_ubound      IN ROWID,
61                                     x_return_status     OUT NOCOPY VARCHAR2,
62                                     x_return_msg        OUT NOCOPY VARCHAR2);
63 
64    -- API used by UNITS.EXECUTE_PLSQL_SET to perform an entire (hopefully small) PLSQL.
65    -- An implicit COMPLETE_PLSQL is called to put the metadata in sync with the data change
66    -- to facilitate autonomous commits.  No commit or rollback is done here.
67    -- Invariants:
68    --   None
69    -- Parameters:
70    --   p_plsql_id:       DSCRAM_PLSQLS.PLSQL_ID of PLSQL to execute
71    --   px_arg_context:   Arg context for execution
72    --   x_return_status:  FND_API-compliant return status
73    --   x_return_msg:     Message explaining non-success return statuses
74    -- Return Statuses:
75    --   G_RET_STS_SUCCESS     Success
76    --   G_RET_STS_ERROR       Expected, possible error found. See return_msg.
77    --   G_RET_STS_ERROR_UNEXP Unexpected Error found.  See return_msg.
78    PROCEDURE EXECUTE_PLSQL(p_plsql_id           IN NUMBER,
79                            px_arg_context       IN OUT NOCOPY FND_OAM_DSCRAM_ARGS_PKG.arg_context,
80                            x_return_status      OUT NOCOPY VARCHAR2,
81                            x_return_msg         OUT NOCOPY VARCHAR2);
82 
83    -- Used by complete_unit to update the writable args for a completed PLSQL.
84    -- Invariants:
85    --   None
86    -- Parameters:
87    --   p_plsql_id:        DSCRAM_PLSQLS.PLSQL_ID of PLSQL to update
88    --   px_arg_context:    Arg context
89    --   p_using_splitting  Boolean indicating whether the args should assume we're using AD Splitting
90    --   x_return_status:   FND_API-compliant return status
91    --   x_return_msg:      Message explaining non-success return statuses
92    -- Return Statuses:
93    --   G_RET_STS_SUCCESS     Success
94    --   G_RET_STS_ERROR       Expected, possible error found. See return_msg.
95    --   G_RET_STS_ERROR_UNEXP Unexpected Error found.  See return_msg.
96    PROCEDURE UPDATE_COMP_PLS_WRITABLE_ARGS(p_plsql_id           IN NUMBER,
97                                            px_arg_context       IN OUT NOCOPY FND_OAM_DSCRAM_ARGS_PKG.arg_context,
98                                            p_using_splitting    IN BOOLEAN,
99                                            x_return_status      OUT NOCOPY VARCHAR2,
100                                            x_return_msg         OUT NOCOPY VARCHAR2);
101 
102    -- Called internally and by _UNIT procedures to mark PLSQLs as completed.  When executing PLSQLs serially,
103    -- this is called after each execute to allow incremental commits.  If the PLSQL was split, this won't
104    -- get called until we're certain that all ranges have been completed and the last worker has succeeded.
105    -- Invariants:
106    --   Since workers_assigned is not provided, this call assumes it is the only and final complete call so it always
107    --   updates the finished state.
108    -- Parameters:
109    --   p_plsql_id:        DSCRAM_PLSQLS.PLSQL_ID of PLSQL to complete
110    --   p_finished_ret_sts Last Execute's return status of the PLSQL
111    --   p_message          Last Execute's return msg
112    --   p_workers_assigned The number of workers assigned to this PLSQL - determines if we should just modify our local
113    --                      cache or make updates to the PLSQL tables.
114    --   x_return_status:   FND_API-compliant return status
115    --   x_return_msg:      Message explaining non-success return statuses
116    -- Return Statuses:
117    --   G_RET_STS_SUCCESS     Success
118    --   G_RET_STS_ERROR       Expected, possible error found. See return_msg.
119    --   G_RET_STS_ERROR_UNEXP Unexpected Error found.  See return_msg.
120    PROCEDURE COMPLETE_PLSQL(p_plsql_id          IN NUMBER,
121                             p_finished_ret_sts  IN VARCHAR2 DEFAULT NULL,
122                             p_message           IN VARCHAR2 DEFAULT NULL,
123                             x_return_status     OUT NOCOPY VARCHAR2,
124                             x_return_msg        OUT NOCOPY VARCHAR2);
125 
126    -- Removes the PLSQL cache entry for a plsql ID and cleans up all child entities
127    -- such as the argument list and the PLSQL's cursor.  Also rolls the arg list into the arg context
128    -- if p_update_context is true.
129    -- Invariants:
130    --   None
131    -- Parameters:
132    --   p_plsql_id:        DSCRAM_PLSQLS.PLSQL_ID of DML to destroy
133    --   px_arg_context:    Arg context
134    --   p_update_context   Boolean indicating whether the arg list should be rolled into the context
135    --   x_return_status:   FND_API-compliant return status
136    --   x_return_msg:      Message explaining non-success return statuses
137    -- Return Statuses:
138    --   G_RET_STS_SUCCESS     Success
139    --   G_RET_STS_ERROR       Expected, possible error found. See return_msg.
140    --   G_RET_STS_ERROR_UNEXP Unexpected Error found.  See return_msg.
141    PROCEDURE DESTROY_PLSQL_CACHE_ENTRY(p_plsql_id       IN NUMBER,
142                                        px_arg_context   IN OUT NOCOPY FND_OAM_DSCRAM_ARGS_PKG.arg_context,
143                                        p_update_context IN BOOLEAN,
144                                        x_return_status  OUT NOCOPY VARCHAR2,
145                                        x_return_msg     OUT NOCOPY VARCHAR2);
146 
147    -- Convenience wrapper to destroy any open plsqls in the cache.  This is the fallback API which
148    -- is always called by complete_unit to make sure that plsqls and arguments are cleaned up.  PLSQLs
149    -- found by this API do not enjoy the privledge of rolling their values into the context.  PLSQLs
150    -- must be specifically completed using the above API for that to happen.
151    -- Invariants:
152    --   None
153    -- Parameters:
154    --   px_arg_context:    Arg context
155    --   x_return_status:   FND_API-compliant return status
156    --   x_return_msg:      Message explaining non-success return statuses
157    -- Return Statuses:
158    --   G_RET_STS_SUCCESS     Success
159    --   G_RET_STS_ERROR       Expected, possible error found. See return_msg.
160    --   G_RET_STS_ERROR_UNEXP Unexpected Error found.  See return_msg.
161    PROCEDURE DESTROY_PLSQL_CACHE(px_arg_context         IN OUT NOCOPY FND_OAM_DSCRAM_ARGS_PKG.arg_context,
162                                  x_return_status        OUT NOCOPY VARCHAR2,
163                                  x_return_msg           OUT NOCOPY VARCHAR2);
164 
165 END FND_OAM_DSCRAM_PLSQLS_PKG;