[Home] [Help]
PACKAGE BODY: APPS.RLM_UI_QUERIES_PKG
Source
1 package body RLM_UI_QUERIES_PKG as
2 /* $Header: RLMQRYB.pls 115.5 2002/11/09 02:02:21 rlanka ship $ */
3
4
5 procedure INSERT_ROW (
6 x_query_id in out NOCOPY number,
7 x_rowid out NOCOPY rowid,
8 query_tab IN query_tab_type
9
10 ) is
11
12 CURSOR c1 is Select rowid from RLM_UI_QUERIES
13 WHERE QUERY_ID = x_QUERY_ID ;
14 v_counter number;
15 BEGIN
16 IF (x_QUERY_ID is NULL) THEN
17 SELECT RLM_UI_QUERIES_S.nextval
18 INTO x_QUERY_ID
19 FROM dual;
20 END IF;
21 FOR v_counter in query_tab.FIRST..query_tab.LAST LOOP
22 INSERT into RLM_UI_QUERY_COLUMNS(
23 QUERY_ID
24 ,COLUMN_NAME
25 ,COLUMN_TYPE
26 ,COLUMN_VALUE
27 ,CREATION_DATE
28 ,CREATED_BY
29 ,LAST_UPDATE_DATE
30 ,LAST_UPDATED_BY
31 ,LAST_UPDATE_LOGIN
32 )
33 VALUES (
34 x_QUERY_ID
35 ,query_tab(v_counter).column_name
36 ,query_tab(v_counter).column_type
37 ,query_tab(v_counter).column_value
38 ,sysdate
39 ,fnd_global.user_id
40 ,sysdate
41 ,fnd_global.user_id
42 ,fnd_global.user_id
43 );
44 END LOOP;
45
46 OPEN c1;
47 FETCH c1 INTO x_rowid;
48 IF (c1%NOTFOUND) THEN
49 raise no_data_found;
50 END IF;
51 CLOSE C1;
52
53 EXCEPTION
54 WHEN Others then null;
55
56 END INSERT_ROW;
57
58
59
60 procedure SELECT_ROW (x_query_id in out NOCOPY number,
61 query_tab OUT NOCOPY query_tab_type) is
62 v_index number := 0;
63 cursor c1 is select * from rlm_ui_query_columns where query_id = x_query_id;
64 begin
65 for c1_rec in c1 loop
66 query_tab(v_index).column_name :=c1_rec.column_name;
67 query_tab(v_index).column_type :=c1_rec.column_type;
68 query_tab(v_index).column_value :=c1_rec.column_value;
69 v_index := v_index+1;
70 end loop;
71 exception
72 when others then null;
73 end SELECT_ROW;
74
75
76
77 procedure UPDATE_ROW (x_query_id in out NOCOPY number,
78 query_tab IN query_tab_type) is
79 v_index number :=0;
80 v_rowid rowid;
81 begin
82 DELETE_ROW(x_query_id);
83 insert_row(x_query_id,
84 v_rowid,
85 query_tab);
86 end;
87
88 procedure DELETE_ROW (x_query_id in out NOCOPY number) is
89 begin
90 delete from rlm_ui_query_columns
91 where query_id = x_query_id;
92 end;
93
94 end RLM_UI_QUERIES_PKG ;