1 PACKAGE JTF_Utility_PVT as
2 /* $Header: jtfgutls.pls 120.1 2005/07/02 00:44:57 appldev ship $ */
3
4 ------------------------------------------------------------------------------
5 -- Comment
6 -- Package
7 -- JTF_Utility_PVT
8 -- File
9 -- jtfgutls.pls
10 -- Purpose
11 -- This package is a private API for some commom tasks.
12 -- Procedures
13 -- check_fk_exists
14 -- check_lookup_exists
15 -- check_uniqueness
16 -- debug_message
17 -- History
18 -- End of Comment
19
20 --SET VERIFY OFF
21 --WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
22
23 g_number CONSTANT NUMBER := 1; -- data type is number
24 g_varchar2 CONSTANT NUMBER := 2; -- data type is varchar2
25
26 resource_locked EXCEPTION;
27 pragma EXCEPTION_INIT(resource_locked, -54);
28
29
30 /****************************************************************************/
31 -- FUNCTION
32 -- check_fk_exists
33 -- PURPOSE
34 -- This function checks if a foreign key is valid.
35 -- NOTES
36 -- 1. It will return FND_API.g_true/g_false.
37 -- 2. Exception encountered will be raised to the caller.
38 -- 3. p_pk_data_type can be JTF_Global_PVT.g_number/g_varchar2.
39 -- 4. Please don't put 'AND' at the beginning of your additional where clause.
40 ------------------------------------------------------------------------------
41 FUNCTION check_fk_exists
42 (
43 p_table_name IN VARCHAR2,
44 p_pk_name IN VARCHAR2,
45 p_pk_value IN VARCHAR2,
46 p_pk_data_type IN NUMBER := g_number,
47 p_additional_where_clause IN VARCHAR2 := NULL
48 )
49 RETURN VARCHAR2; -- FND_API.g_true/g_false
50
51
52 /****************************************************************************/
53 -- FUNCTION
54 -- check_uniqueness
55 -- PURPOSE
56 -- This function is to check the uniqueness of the keys.
57 -- In order to make this function more flexible, you need to
58 -- pass in where clause of your unique keys check.
59 ------------------------------------------------------------------------------
60 FUNCTION check_uniqueness
61 (
62 p_table_name IN VARCHAR2,
63 p_where_clause IN VARCHAR2
64 )
65 RETURN VARCHAR2; -- FND_API.g_true/g_false
66
67
68 /****************************************************************************/
69 -- PROCEDURE
70 -- debug_message
71 -- PURPOSE
72 -- This procedure will check the message level and try to add a
73 -- debug message into the message table of FND_MSG_API package.
74 -- Note that this debug message won't be translated.
75 ------------------------------------------------------------------------------
76 PROCEDURE debug_message
77 (
78 p_message_text IN VARCHAR2,
79 p_message_level IN NUMBER := FND_MSG_PUB.g_msg_lvl_debug_high
80 );
81
82 /****************************************************************************/
83 -- PROCEDURE
84 -- display_messages
85 -- PURPOSE
86 -- This procedure will display all messages in the message list
87 -- using DBMS_OUTPUT.put_line( ) .
88 ------------------------------------------------------------------------------
89 PROCEDURE display_messages;
90
91 END JTF_Utility_PVT;