1: PACKAGE BODY GHG_SOURCE_COMBINATIONS_PKG AS
2: /*$Header: ghgsrcmb.pls 120.0.12020000.1 2012/10/18 05:13:55 mgijare noship $ */
3:
4: PROCEDURE insert_row (x_rowid IN OUT NOCOPY VARCHAR2,
5: x_source_comb_id NUMBER,
31: v_debug_info VARCHAR2(100);
32:
33: CURSOR c IS
34: SELECT ROWID
35: FROM GHG_SOURCE_COMBINATIONS
36: WHERE source_combination_id = x_source_comb_id;
37:
38: BEGIN
39:
36: WHERE source_combination_id = x_source_comb_id;
37:
38: BEGIN
39:
40: v_debug_info := 'Inserting into GHG_SOURCE_COMBINATIONS';
41:
42: INSERT INTO GHG_SOURCE_COMBINATIONS (source_combination_id,
43: source_combination_code,
44: source_combination_description,
38: BEGIN
39:
40: v_debug_info := 'Inserting into GHG_SOURCE_COMBINATIONS';
41:
42: INSERT INTO GHG_SOURCE_COMBINATIONS (source_combination_id,
43: source_combination_code,
44: source_combination_description,
45: source_id,
46: start_date,
150: v_debug_info VARCHAR2(100);
151:
152: BEGIN
153:
154: v_debug_info := 'Updating GHG_SOURCE_COMBINATIONS';
155:
156: UPDATE GHG_SOURCE_COMBINATIONS
157: SET source_combination_id = x_source_comb_id,
158: source_combination_code = x_source_comb_code,
152: BEGIN
153:
154: v_debug_info := 'Updating GHG_SOURCE_COMBINATIONS';
155:
156: UPDATE GHG_SOURCE_COMBINATIONS
157: SET source_combination_id = x_source_comb_id,
158: source_combination_code = x_source_comb_code,
159: source_combination_description = x_source_comb_desc,
160: source_id = x_source_id,
204: v_debug_info VARCHAR2(100);
205:
206: BEGIN
207:
208: DELETE FROM GHG_SOURCE_COMBINATIONS
209: WHERE source_combination_id = x_source_comb_id;
210:
211: IF (sql%notfound) THEN
212: RAISE no_data_found;
282: last_updated_by,
283: last_update_date,
284: last_update_login,
285: org_id
286: FROM GHG_SOURCE_COMBINATIONS
287: WHERE rowid = x_rowid
288: FOR UPDATE of source_id NOWAIT;
289: recinfo C%ROWTYPE;
290:
385: v_row_count number;
386: BEGIN
387: SELECT count(*)
388: into v_row_count
389: FROM GHG_SOURCE_COMBINATIONS_ALL
390: where source_combination_id = x_source_comb_id;
391:
392: IF v_row_count > 0 THEN
393: RETURN TRUE;
398:
399: FUNCTION generate_source_comb_id RETURN NUMBER IS
400: v_source_comb_id NUMBER;
401: BEGIN
402: select GHG_SOURCE_COMBINATIONS_S.NEXTVAL
403: into v_source_comb_id
404: from dual;
405:
406: RETURN v_source_comb_id;
405:
406: RETURN v_source_comb_id;
407: END;
408:
409: END GHG_SOURCE_COMBINATIONS_PKG;