156: Pa_Debug.G_Stage := 'Delete the working version element/nodes.';
157: Begin
158: Delete
159: From
160: Pa_Rbs_Elements
161: Where
162: Rbs_Version_Id = P_Rbs_Version_Id;
163:
164: Exception
340: Cursor C_GetRbsElementNameId(l_Rbs_Version_Id IN Number) is
341: Select
342: rbs_element_name_id
343: From
344: pa_rbs_elements
345: Where
346: rbs_version_id = l_Rbs_Version_Id
347: and outline_number = '0';
348:
422: P_Record_Version_Number => P_Record_Version_Number,
423: X_Error_Msg_Data => X_Error_Msg_Data);
424:
425: Pa_Debug.G_Stage := 'Delete the record in pa_rbs_element_names table corresponding to that ' ||
426: 'of top most element in pa_rbs_elements table.';
427: If X_Error_Msg_Data is null then
428:
429: Begin
430:
581:
582: Pa_Debug.G_Stage := 'Entering Copy_Frozen_Rbs_Elements() procedure.';
583: Pa_Debug.TrackPath('ADD','Copy_Frozen_Rbs_Elements');
584:
585: Pa_Debug.G_Stage := 'Delete all records from Pa_Rbs_Elements_Temp.';
586: Begin
587:
588: Delete
589: From Pa_Rbs_Elements_Temp;
585: Pa_Debug.G_Stage := 'Delete all records from Pa_Rbs_Elements_Temp.';
586: Begin
587:
588: Delete
589: From Pa_Rbs_Elements_Temp;
590:
591: Exception
592: When No_Data_Found Then
593: null;
593: null;
594:
595: End;
596:
597: Pa_Debug.G_Stage := 'Insert into Pa_Rbs_Elements_Temp that are to be copied.';
598: /*******************************************************
599: * Bug - 3591534
600: * Desc - while inserting into Pa_Rbs_Elements_Temp elements that
601: * are to be copied, we should only select elements where
596:
597: Pa_Debug.G_Stage := 'Insert into Pa_Rbs_Elements_Temp that are to be copied.';
598: /*******************************************************
599: * Bug - 3591534
600: * Desc - while inserting into Pa_Rbs_Elements_Temp elements that
601: * are to be copied, we should only select elements where
602: * user_created flag = 'Y'.
603: ******************************************************/
604: Insert Into Pa_Rbs_Elements_Temp(
600: * Desc - while inserting into Pa_Rbs_Elements_Temp elements that
601: * are to be copied, we should only select elements where
602: * user_created flag = 'Y'.
603: ******************************************************/
604: Insert Into Pa_Rbs_Elements_Temp(
605: New_Element_Id,
606: Old_Element_Id,
607: Old_Parent_Element_Id,
608: New_Parent_Element_Id )
606: Old_Element_Id,
607: Old_Parent_Element_Id,
608: New_Parent_Element_Id )
609: (Select
610: Pa_Rbs_Elements_S.NextVal,
611: Rbs_Element_Id,
612: Parent_Element_Id,
613: Null
614: From
611: Rbs_Element_Id,
612: Parent_Element_Id,
613: Null
614: From
615: Pa_Rbs_Elements
616: Where
617: Rbs_Version_Id = P_Rbs_Version_From_Id
618: and user_created_flag = 'Y' );
619:
616: Where
617: Rbs_Version_Id = P_Rbs_Version_From_Id
618: and user_created_flag = 'Y' );
619:
620: Pa_Debug.G_Stage := 'Update Pa_Rbs_Elements_Temp records with the correct parent element id.';
621: Update Pa_Rbs_Elements_Temp Tmp1
622: Set New_Parent_Element_Id =
623: (Select
624: New_Element_Id
617: Rbs_Version_Id = P_Rbs_Version_From_Id
618: and user_created_flag = 'Y' );
619:
620: Pa_Debug.G_Stage := 'Update Pa_Rbs_Elements_Temp records with the correct parent element id.';
621: Update Pa_Rbs_Elements_Temp Tmp1
622: Set New_Parent_Element_Id =
623: (Select
624: New_Element_Id
625: From
622: Set New_Parent_Element_Id =
623: (Select
624: New_Element_Id
625: From
626: Pa_Rbs_Elements_Temp Tmp2
627: Where
628: Tmp1.Old_Parent_Element_Id = Tmp2.Old_Element_Id);
629:
630: Pa_Debug.G_Stage := 'Insert into Pa_Rbs_Elements new records.';
626: Pa_Rbs_Elements_Temp Tmp2
627: Where
628: Tmp1.Old_Parent_Element_Id = Tmp2.Old_Element_Id);
629:
630: Pa_Debug.G_Stage := 'Insert into Pa_Rbs_Elements new records.';
631:
632: /*Bug 4377886 : Included explicitly the column names in the INSERT statement
633: to remove the GSCC Warning File.Sql.33 */
634: Insert Into Pa_Rbs_Elements
630: Pa_Debug.G_Stage := 'Insert into Pa_Rbs_Elements new records.';
631:
632: /*Bug 4377886 : Included explicitly the column names in the INSERT statement
633: to remove the GSCC Warning File.Sql.33 */
634: Insert Into Pa_Rbs_Elements
635: (
636: RBS_ELEMENT_ID,
637: RBS_ELEMENT_NAME_ID,
638: RBS_VERSION_ID,
714: Pa_Rbs_Versions_Pvt.G_Created_By,
715: Pa_Rbs_Versions_Pvt.G_Last_Update_Login,
716: 1
717: From
718: Pa_Rbs_Elements_Temp Tmp,
719: Pa_Rbs_Elements Rbs_Elements
720: Where
721: Tmp.Old_Element_Id = Rbs_Elements.Rbs_Element_Id;
722:
715: Pa_Rbs_Versions_Pvt.G_Last_Update_Login,
716: 1
717: From
718: Pa_Rbs_Elements_Temp Tmp,
719: Pa_Rbs_Elements Rbs_Elements
720: Where
721: Tmp.Old_Element_Id = Rbs_Elements.Rbs_Element_Id;
722:
723: --Bug 3592145
733: 'root element element_name_id.';
734: If l_Dummy_Error_Status = Fnd_Api.G_Ret_Sts_Success Then
735:
736: Pa_Debug.G_Stage := 'Updating the root element rbs record with the new element_name_id.';
737: Update Pa_Rbs_Elements
738: Set Rbs_Element_Name_Id = l_New_Element_Name_Id,
739: Resource_Source_Id = P_Rbs_Version_To_Id
740: Where Rbs_Version_Id = P_Rbs_Version_To_Id
741: And Resource_Type_Id = -1