DBA Data[Home] [Help]

PACKAGE: APPS.GL_JOURNAL_IMPORT_PKG

Source


1 PACKAGE GL_JOURNAL_IMPORT_PKG as
2 /* $Header: glujimns.pls 120.6 2006/06/07 16:30:32 djogg ship $ */
3 /*#
4  * Provides functions to use with Journal Import.
5  * @rep:scope public
6  * @rep:product GL
7  * @rep:lifecycle active
8  * @rep:displayname Journal Import Functions
9  * @rep:compatibility S
10  * @rep:category BUSINESS_ENTITY GL_JOURNAL
11  */
12 
13 --
14 -- Package
15 --   GL_JOURNAL_IMPORT_PKG
16 -- Purpose
17 --   Various utilities for working directly with Journal Import
18 -- History
19 --   09-OCT-2000  D J Ogg          Created.
20 --
21 
22   -- This exception is raised when we fail to get the applsys schema
23   -- information in the create_table and drop_table routines
24   CANNOT_GET_APPLSYS_SCHEMA EXCEPTION;
25 
26   -- This exception is raised when the populate_interface_control routine
27   -- is passed an invalid journal entry source name
28   INVALID_JE_SOURCE EXCEPTION;
29 
30   -- This exception is raised when the populate_interface_control routine
31   -- is passed an invalid processed_data_action
32   INVALID_PROCESSED_ACTION EXCEPTION;
33 
34   -- This exception is raised when the populate_interface_control routine
35   -- is passed parameters that would imply that gl_interface should be
36   -- dropped.
37   CANNOT_DROP_GL_INTERFACE EXCEPTION;
38 
39 
40   -- Constants for use with the processed_data_action parameter of
41   -- the populate_interface_control procedure.
42   SAVE_DATA		CONSTANT	VARCHAR2(1) := 'S';
43   DELETE_DATA		CONSTANT	VARCHAR2(1) := 'D';
44   DROP_INTERFACE_TABLE	CONSTANT	VARCHAR2(1) := 'R';
45 
46   --
47   -- Procedure
48   --   create_table
49   -- Purpose
50   --   Creates a copy of the gl_interface table with the given
51   --   name and storage parameters.  The table will be created
52   --   in the gl schema.
53   -- History
54   --   09-OCT-2000  D. J. Ogg    Created
55   -- Arguments
56   --   table_name       	The name of the new table
57   --   tablespace		The tablespace the table should be created in
58   --   physical_attributes	The physical attributes clause for the
59   --                            creation of the table
60   --   create_n1_index          Indicates whether or not the n1 index should
61   --                            be created
62   --   n1_tablespace            The tablespace the n1 index should be created
63   --                            in
64   --   n1_physical_attributes   The physical attributes clause for the
65   --                            creation of the n1 index
66   --   create_n2_index          Indicates whether or not the n2 index should
67   --                            be created
68   --   n2_tablespace            The tablespace the n2 index should be created
69   --                            in
70   --   n2_physical_attributes   The physical attributes clause for the
71   --                            creation of the n2 index
72   -- Example
73   --   gl_journal_import_pkg.create_table(
74   --      'GL_CUSTOM_INTERFACE',
75   --      'TAB1',
76   --      'PCTFREE 10 STORAGE (INITIAL 500K NEXT 1M)',
77   --      FALSE,
78   --      NULL,
79   --      NULL,
80   --      TRUE,
81   --      'IND1',
82   --      'STORAGE (INITIAL 10K NEXT 20K)');
83   -- Notes
84   --
85 /*#
86  * Creates a copy of the GL_INTERFACE table. The newly created copy is created in
87  * the GL schema and has the name and storage parameters provided by the user.
88  * Journal Import can pull data from the newly created interface table to
89  * create journals.
90  * @param table_name Name of new table.
91  * @param tablespace Tablespace that will contain the new table.
92  * @param physical_attributes Physical attributes clause to be used in the creation of the new table.
93  * @param create_n1_index Indicates whether a copy of the GL_INTERFACE_N1 index is created for this table.
94  * @param n1_tablespace Tablespace that will contain a copy of the GL_INTERFACE_N1 index.
95  * @param n1_physical_attributes Physical attributes clause to be used in the creation of a copy of the GL_INTERFACE_N1 index.
96  * @param create_n2_index Indicates whether a copy of the GL_INTERFACE_N2 index is created for this table.
97  * @param n2_tablespace Tablespace that will contain a copy of the GL_INTERFACE_N2 index.
98  * @param n2_physical_attributes Physical attributes clause to be used in the creation of a copy of the GL_INTERFACE_N2 index.
99  * @rep:scope public
100  * @rep:lifecycle active
101  * @rep:displayname Create Journal Interface Table
102  * @rep:compatibility S
103  * @rep:category BUSINESS_ENTITY GL_JOURNAL
104  */
105   PROCEDURE create_table(table_name 			VARCHAR2,
106                          tablespace 			VARCHAR2 DEFAULT NULL,
107                          physical_attributes 		VARCHAR2 DEFAULT NULL,
108 			 create_n1_index		BOOLEAN DEFAULT TRUE,
109 			 n1_tablespace			VARCHAR2 DEFAULT NULL,
110 			 n1_physical_attributes		VARCHAR2 DEFAULT NULL,
111 			 create_n2_index		BOOLEAN DEFAULT TRUE,
112 			 n2_tablespace			VARCHAR2 DEFAULT NULL,
113 			 n2_physical_attributes		VARCHAR2 DEFAULT NULL
114                         );
115 
116   --
117   -- Procedure
118   --   drop_table
119   -- Purpose
120   --   Drops a copy of the gl_interface table from the gl schema
121   -- History
122   --   09-OCT-2000  D. J. Ogg    Created
123   -- Arguments
124   --   table_name       	The name of the new table
125   -- Example
126   --   gl_journal_import_pkg.drop_table(
127   --      'GL_CUSTOM_INTERFACE');
128   -- Notes
129   --
130 /*#
131  * Drops a copy of the GL_INTERFACE table, which must be in the GL schema.
132  * @param table_name Name of the table to drop.
133  * @rep:scope public
134  * @rep:lifecycle active
135  * @rep:displayname Drop Journal Interface Table
136  * @rep:compatibility S
137  * @rep:category BUSINESS_ENTITY GL_JOURNAL
138  */
139   PROCEDURE drop_table(table_name 			VARCHAR2);
140 
141   --
142   -- Procedure
143   --   populate_interface_control
144   -- Purpose
145   --   Populates the gl_interface_control table.  This routine does not
146   --   do a commit.  Returns the interface run id.
147   -- History
148   --   09-OCT-2000  D. J. Ogg    Created
149   -- Arguments
150   --   user_je_source_name      User friendly version of the source name
151   --   group_id                 Group id to be processed.  If none is
152   --                            provided, one will be automatically generated
153   --                            and passed back through this parameter.
154   --   set_of_books_id          Ledger Id to be used
155   --   interface_run_id		Interface run id to be used.  If none is
156   --                            provided, one will be automatically generated
157   --                            and passed back through this parameter.
158   --   table_name       	The name of the new table
159   --   processed_data_action    Indicates what to do with the data and table
160   --                            if it is successfully imported.
161   --                            Valid options are SAVE_DATA, DELETE_DATA,
162   --                            and DROP_INTERFACE_TABLE
163   -- Example
164   --   gl_journal_import_pkg.populate_interface_control(
165   --      'Custom',
166   --      5001,
167   --      1,
168   --      'GL_CUSTOM_INTERFACE');
169   -- Notes
170   --
171 /*#
172  * Communicates to Journal Import the source and GROUP_ID of transaction data
173  * to be processed, its location, and the action to take when it is
174  * imported successfully. This information is stored in the GL_INTERFACE_CONTROL
175  * table under the specified value of INTERFACE_RUN_ID. When Journal Import
176  * is run for that INTERFACE_RUN_ID, the specified data is processed.
177  *
178  * The TABLE_NAME parameter specifies the table in which the data is stored.
179  * If no value is specified for this parameter, then the table is assumed to be
180  * GL_INTERFACE. If the data is stored in a table other than GL_INTERFACE, then
181  * information about the location of the data is saved in GL_INTERFACE_CONTROL
182  * until the data is imported successfully. Any Journal Import run that processes
183  * that source and GROUP_ID will retrieve data from the specified table,
184  * even if run for a different INTERFACE_RUN_ID. Once the data is imported
185  * successfully, the row is deleted from GL_INTERFACE_CONTROL. Any
186  * additional runs of Journal Import for that source and GROUP_ID will retrieve
187  * data from the GL_INTERFACE table.
188  *
189  * The PROCESSED_DATA_ACTION parameter specifies the method to use in handling
190  * the data once it is successfully processed. Valid values are
191  * gl_journal_import_pkg.SAVE_DATA, gl_journal_import_pkg.DELETE_DATA,
192  * and gl_journal_import_pkg.DROP_INTERFACE_TABLE. The value,
193  * gl_journal_import_pkg.SAVE_DATA, leaves the data in
194  * the interface table, but does not allow it to be reimported. The value,
195  * gl_journal_import_pkg.DELETE_DATA, indicates the data should be deleted from
196  * the interface table, and the value, gl_journal_import_pkg.DROP_INTERFACE_TABLE,
197  * indicates the interface table should be dropped if all of its data has been
198  * processed successfully by the Journal Import run. If the table cannot be
199  * dropped or if all of the data in the table has not been processed, the data is
200  * deleted. Note, however, that the GL_INTERFACE table is never
201  * dropped, regardless of the setting of the PROCESSED_DATA_ACTION parameter.
202  *
203  * If no value is specified for the PROCESSED_DATA_ACTION parameter, then the
204  * data is deleted once it has been successfully processed. If a value is
205  * specified other than gl_journal_import_pkg.DELETE_DATA, then the action to
206  * take for this data is saved in
207  * GL_INTERFACE_CONTROL until the data is imported successfully. Any Journal
208  * Import run that processes that source and GROUP_ID will execute this action
209  * upon importing the data successfully, even if run for a different
210  * INTERFACE_RUN_ID. Once the data is imported successfully, the row is
211  * deleted from GL_INTERFACE_CONTROL. Any additional runs of Journal Import
212  * for that source and GROUP_ID will execute the default action of deleting
213  * any successfully imported data.
214  *
215  * If a null value of INTERFACE_RUN_ID is passed to this routine, then the routine
216  * automatically generates and returns a unique INTERFACE_RUN_ID.  If a null value
217  * of GROUP_ID is passed to this routine, then the routine automatically
218  * generates and returns a unique GROUP_ID.
219  * @param user_je_source_name User-friendly journal source name of the data to be processed.
220  * @param group_id Group id of the data to be processed.
221  * @param set_of_books_id Ledger id of the data to be processed.
222  * @param interface_run_id Identifier of a specific Journal Import run.
223  * @param table_name Table that contains the data to be processed.
224  * @param processed_data_action Action to take once the data has been successfully processed.
225  * @rep:scope public
226  * @rep:lifecycle active
227  * @rep:displayname Populate Interface Control
228  * @rep:compatibility S
229  * @rep:category BUSINESS_ENTITY GL_JOURNAL
230  */
231 
232   PROCEDURE populate_interface_control(
233               user_je_source_name	VARCHAR2,
234 	      group_id			IN OUT NOCOPY	NUMBER,
235               set_of_books_id           NUMBER,
236               interface_run_id 		IN OUT NOCOPY  NUMBER,
237 	      table_name 	       	VARCHAR2 DEFAULT NULL,
238               processed_data_action   	VARCHAR2 DEFAULT NULL);
239 
240   --
241   -- Procedure
242   --   get_last_sql
243   -- Purpose
244   --   Returns the last attempted sql*statement executed by the
245   --   create_table and drop_table routines
246   -- History
247   --   09-OCT-2000  D. J. Ogg    Created
248   -- Arguments
249   --   * NONE *
250   -- Example
251   --   last_sql := gl_journal_import_pkg.get_last_sql;
252   -- Notes
253   --
254 /*#
255  * Returns the last sql* statement executed by the CREATE_TABLE and DROP_TABLE
256  * routines.
257  * @return Last sql*statement executed by the CREATE_TABLE and DROP_TABLE routines.
258  * @rep:scope public
259  * @rep:lifecycle active
260  * @rep:displayname Get Last Create/Drop SQL Statement
261  * @rep:compatibility S
262  * @rep:category BUSINESS_ENTITY GL_JOURNAL
263  */
264   FUNCTION get_last_sql RETURN VARCHAR2;
265 
266   --
267   -- Procedure
268   --   get_error_msg
269   -- Purpose
270   --   Returns the last error message, if any, for the create_table
271   --   and drop_table routines
272   -- History
273   --   09-OCT-2000  D. J. Ogg    Created
274   -- Arguments
275   --   * NONE *
276   -- Example
277   --   errmsg := gl_journal_import_pkg.get_error_msg;
278   -- Notes
279   --
280 /*#
281  * Returns the last error message, if any, produced by the CREATE_TABLE and DROP_TABLE
282  * routines.
283  * @return Last error message produced by the CREATE_TABLE and DROP_TABLE routines.
284  * @rep:scope public
285  * @rep:lifecycle active
286  * @rep:displayname Get Last Create/Drop Error Message
287  * @rep:compatibility S
288  * @rep:category BUSINESS_ENTITY GL_JOURNAL
289  */
290   FUNCTION get_error_msg RETURN VARCHAR2;
291 
292 
293 END GL_JOURNAL_IMPORT_PKG;