1: PACKAGE BODY MTH_UDA_PKG AS
2: /*$Header: mthuntbb.pls 120.6.12010000.2 2008/09/09 00:52:16 tkan ship $*/
3:
4: PROCEDURE UPDATE_TO_PRIMARY_KEY(P_ENTITY IN VARCHAR2) IS
5: --initialize variables here
22:
23:
24:
25: -- Get the pk key
26: v_pk_column := MTH_UDA_PKG.Get_Mst_Pk_Name(p_entity);
27: IF (v_pk_column IS null) THEN
28: RAISE e_tname_not_found;
29: END IF;
30:
124: NULL; -- allow compilation
125: /*
126: Using the p_entity, get the primary key column name
127: */
128: v_pk_column := MTH_UDA_PKG.Get_Mst_Pk_Name(p_entity);
129: IF (v_pk_column = null) THEN
130: RAISE e_tname_not_found;
131: END IF;
132:
132:
133: /*
134: Now get the EXT_TL and EXT_B names
135: */
136: v_tname_b := MTH_UDA_PKG.Get_Ext_Table_Name(p_entity);
137: IF (v_tname_b = NULL) THEN
138: RAISE e_tname_not_found;
139: END IF;
140:
137: IF (v_tname_b = NULL) THEN
138: RAISE e_tname_not_found;
139: END IF;
140:
141: v_tname_tl := MTH_UDA_PKG.Get_Ext_TL_Table_Name(p_entity);
142: IF (v_tname_tl = NULL) THEN
143: RAISE e_tname_not_found;
144: END IF;
145:
160:
161: ELSE
162: -- CALL to who upload column
163: --DBMS_OUTPUT.PUT_LINE('UPDating the who columns');
164: MTH_UDA_PKG.NTB_Upload_Standard_Who(v_tname_tl,p_extId,p_if_row_exists);
165: END IF;
166:
167:
168:
227: -- main body
228: BEGIN
229: NULL; -- allow compilation
230: -- Call the procedure to rename columns to the pkey columns
231: MTH_UDA_PKG.Update_To_Primary_Key(v_entity);
232:
233:
234: -- Code to get find out table name depending on the entity input
235: v_stmt_no := 5;
232:
233:
234: -- Code to get find out table name depending on the entity input
235: v_stmt_no := 5;
236: v_tname := MTH_UDA_PKG.Get_Ext_Table_Name(v_entity);
237: IF (v_tname is NULL) THEN
238: RAISE e_tname_not_found;
239: END IF;
240:
447: /*
448: call procedure to update standard who columns
449: */
450: --DBMS_OUTPUT.PUT_LINE('calling who procedure');
451: MTH_UDA_PKG.NTB_Upload_Standard_Who(v_tname,v_extId, v_if_row_exists);
452:
453: /*
454: Call the procedure to update TL Table
455: */
452:
453: /*
454: Call the procedure to update TL Table
455: */
456: MTH_UDA_PKG.NTB_UploadTL(v_entity,v_extId,v_if_row_exists);
457:
458: END LOOP;
459: END LOOP;
460:
481: BEGIN
482: NULL; -- allow compilation
483:
484: -- Get the code for the entity
485: v_entity_code := MTH_UDA_PKG.Get_Entity_Code(p_entity);
486:
487: -- Check if v_entity_code is -1, if so, return NULL
488: IF (v_entity_code = -1) THEN
489: RETURN NULL;
508: -- main body
509: BEGIN
510: NULL; -- allow compilation
511: -- Get the code for the entity
512: v_entity_code := MTH_UDA_PKG.Get_Entity_Code(p_entity);
513:
514: -- Check if v_entity_code is -1, if so, return NULL
515: IF (v_entity_code = -1) THEN
516: RETURN NULL;
535: BEGIN
536: NULL; -- allow compilation
537:
538: -- Get the code for the entity
539: v_entity_code := MTH_UDA_PKG.Get_Entity_Code(p_entity);
540:
541: -- Check if v_entity_code is -1, if so, return NULL
542: IF (v_entity_code = -1) THEN
543: RETURN NULL;
561: -- main body
562: BEGIN
563: NULL; -- allow compilation
564: -- Get the code for the entity
565: v_entity_code := MTH_UDA_PKG.Get_Entity_Code(p_entity);
566:
567: -- Check if v_entity_code is -1, if so, return NULL
568: IF (v_entity_code = -1) THEN
569: RETURN NULL;
834:
835: END;
836: -- End of TB_UPLOAD;
837:
838: END MTH_UDA_PKG;