1 PACKAGE FND_API AUTHID DEFINER AS
2 /* $Header: AFASAPIS.pls 120.1 2005/07/02 03:56:53 appldev ship $ */
3
4 -- *** G_MISS_XXX should no longer be used to default missing values.
5 -- *** Please see GSCC Standard File.Sql.48 and the new G_NULL_XXXX
6 -- *** constants defined at the end of this spec.
7 -- Global constants that represent missing values. These constants
8 -- are used as default values for PL/SQL procedures and functions
9 -- parameters to distinguish between parameters that are passed and
10 -- have a value of NULL and those which are not passed to the procedure.
11 G_MISS_NUM CONSTANT NUMBER := 9.99E125;
12 G_MISS_CHAR CONSTANT VARCHAR2(1) := chr(0);
13 G_MISS_DATE CONSTANT DATE := TO_DATE('1','j');
14
15 -- Pre-defined validation levels
16 --
17 -- NONE : Means the lowest validation level possible for a
18 -- particular transaction.
19 --
20 -- FULL : Means the highest validation level possible for a
21 -- particular transaction.
22
23
24 G_VALID_LEVEL_NONE CONSTANT NUMBER := 0;
25 G_VALID_LEVEL_FULL CONSTANT NUMBER := 100;
26
27 -- FUNCTION Compatible_API_Call
28 --
29 -- Usage Used by all APIs to compare a caller version number to
30 -- an API version number in order to detect incompatible
31 -- API calls.
32 -- Every API has a standard call to this function.
33 --
34 -- Desc This function compares the major version number passed
35 -- by an API caller to the current major version number
36 -- of the API itself, if they are different this means
37 -- that a program is making an incompatible API call. In
38 -- this case, the function issues a standard unexpected
39 -- error message and returns FALSE.
40 --
41 -- Parameters
42 --
43 -- Return Boolean.
44 -- If the p_current_version_number matches the
45 -- p_caller_version_number the function returns TRUE else
46 -- it returns FALSE.
47
48
49 FUNCTION Compatible_API_Call
50 ( p_current_version_number IN NUMBER ,
51 p_caller_version_number IN NUMBER ,
52 p_api_name IN VARCHAR2 ,
53 p_pkg_name IN VARCHAR2
54 )
55 RETURN BOOLEAN;
56
57 -- API return status
58 --
59 -- G_RET_STS_SUCCESS means that the API was successful in performing
60 -- all the operation requested by its caller.
61 --
62 -- G_RET_STS_ERROR means that the API failed to perform one or more
63 -- of the operations requested by its caller.
64 --
65 -- G_RET_STS_UNEXP_ERROR means that the API was not able to perform
66 -- any of the operations requested by its callers because of an
67 -- unexpected error.
68
69
70 G_RET_STS_SUCCESS CONSTANT VARCHAR2(1) := 'S';
71 G_RET_STS_ERROR CONSTANT VARCHAR2(1) := 'E';
72 G_RET_STS_UNEXP_ERROR CONSTANT VARCHAR2(1) := 'U';
73
74 -- API error exceptions.
75 -- G_EXC_ERROR : Is used within API bodies to indicate an error,
76 -- this exception should always be handled within the
77 -- API body and p_return_status shoul;d be set to
78 -- error. An API should never return this exception.
79 -- G_EXC_UNEXPECTED_ERROR :
80 -- Is raised by APIs when encountering an unexpected
81 -- error.
82
83 G_EXC_ERROR EXCEPTION;
84 G_EXC_UNEXPECTED_ERROR EXCEPTION;
85
86 -- Global constants representing TRUE and FALSE.
87
88 G_TRUE CONSTANT VARCHAR2(1) := 'T';
89 G_FALSE CONSTANT VARCHAR2(1) := 'F';
90
91 -- FUNCTION To_Boolean ( p_char IN VARCHAR2 ) RETURN BOOLEAN
92 --
93 -- Usage Used to convert varchar2 boolean like parameters into
94 -- their boolean equivalents.
95 --
96 -- Desc This function converts a character string into its
97 -- BOOLEAN equivalent by comparing it against the G_TRUE
98 -- and G_FALSE constants defined in this package. the
99 -- comparison is as follows :
100 --
101 -- p_char = G_TRUE => Returns TRUE
102 -- p_char = G_FALSE => Returns FALSE
103 -- p_char = NULL => Returns NULL
104 -- Otherwise, the function raises the exception
105 -- FND_API.G_EXC_UNEXPECTED_ERROR, and adds a message o
106 -- the API message list.
107 --
108 -- Parameters
109 -- IN p_char :
110 -- Character value to be converted. Legal values are
111 -- 'T' or FND_API.G_TRUE
112 -- 'F' or FND_API.G_FALSE
113 -- NULL
114 -- Return Boolean.
115 -- p_char = G_TRUE => Returns TRUE
116 -- p_char = G_FALSE => Returns FALSE
117 -- p_char = NULL => Returns NULL
118 -- Otherwise, the function raises the exception
119 -- FND_API.G_EXC_UNEXPECTED_ERROR, and adds a message o
120 -- the API message list.
121
122 FUNCTION To_Boolean ( p_char IN VARCHAR2 ) RETURN BOOLEAN;
123
124 -- Types and constants used by shared API packages as well as the
125 -- PL/SQL API generator.
126
127 -- Attribute record type.
128
129 TYPE Attribute_Rec_Type IS RECORD
130 ( name VARCHAR2(30) := NULL
131 , column VARCHAR2(30) := NULL
132 , code VARCHAR2(30) := NULL
133 , value BOOLEAN := FALSE
134 , value_type VARCHAR2(30) := NULL
135 , type VARCHAR2(30) := NULL
136 , length NUMBER := NULL
137 , context BOOLEAN := FALSE
138 , category NUMBER := NULL
139 , db_attr BOOLEAN := TRUE
140 , pk_flag BOOLEAN := FALSE
141 , text1 VARCHAR2(30) := NULL
142 , text2 VARCHAR2(30) := NULL
143 , text3 VARCHAR2(30) := NULL
144 );
145
146 -- Attribute table type.
147
148 TYPE Attribute_Tbl_Type IS TABLE OF Attribute_Rec_Type
149 INDEX BY BINARY_INTEGER;
150
151 -- Gloabl attribute table.
152
153 g_attr_tbl Attribute_Tbl_Type;
154
155 -- Missing constants
156
157 G_MISS_ATTR_REC Attribute_Rec_Type;
158 G_MISS_ATTR_TBL Attribute_Tbl_Type;
159
160 -- Entity record type.
161
162 TYPE Entity_Rec_Type IS RECORD
163 ( name VARCHAR2(30) := NULL
164 , tbl VARCHAR2(30) := NULL
165 , parent NUMBER := NULL
166 , multiple BOOLEAN := FALSE
167 , code VARCHAR2(30) := NULL
168 , pk_column VARCHAR2(30) := NULL
169 , text1 VARCHAR2(30) := NULL
170 , text2 VARCHAR2(30) := NULL
171 , text3 VARCHAR2(30) := NULL
172 );
173
174 -- Entity table type.
175
176 TYPE Entity_Tbl_Type IS TABLE OF Entity_Rec_Type
177 INDEX BY BINARY_INTEGER;
178
179 -- Missing constants
180
181 G_MISS_ENTITY_REC Entity_Rec_Type;
182 G_MISS_ENTITY_TBL Entity_Tbl_Type;
183
184 -- Gloabl entity table.
185
186 g_entity_tbl Entity_Tbl_Type;
187
188 -- Added for New GSCC Standard File.Sql.48
189 -- The new standard is to treat missing values as NULL and to use the
190 -- G_NULL_XXX constants to assign a value of NULL to a variable if needed.
191 G_NULL_NUM CONSTANT NUMBER := 9.99E125;
192 G_NULL_CHAR CONSTANT VARCHAR2(1) := chr(0);
193 G_NULL_DATE CONSTANT DATE := TO_DATE('1','j');
194
195 END FND_API;