637: -- 4. Define dynamic sql columns
638: -- 5. Execute and fetch dynamic sql
639: --
640: hr_Utility.Set_Location(l_proc, 6);
641: l_sql_cursor := dbms_sql.open_cursor; -- Step 1
642: --
643: hr_Utility.Set_Location(l_proc, 10);
644: dbms_sql.parse(l_sql_cursor, l_dynamic_sql, dbms_sql.v7); -- Step 2
645: --
640: hr_Utility.Set_Location(l_proc, 6);
641: l_sql_cursor := dbms_sql.open_cursor; -- Step 1
642: --
643: hr_Utility.Set_Location(l_proc, 10);
644: dbms_sql.parse(l_sql_cursor, l_dynamic_sql, dbms_sql.v7); -- Step 2
645: --
646: hr_Utility.Set_Location(l_proc, 15);
647: dbms_sql.bind_variable(l_sql_cursor, -- Step 3
648: ':p_participation_in_id', p_participation_in_id);
643: hr_Utility.Set_Location(l_proc, 10);
644: dbms_sql.parse(l_sql_cursor, l_dynamic_sql, dbms_sql.v7); -- Step 2
645: --
646: hr_Utility.Set_Location(l_proc, 15);
647: dbms_sql.bind_variable(l_sql_cursor, -- Step 3
648: ':p_participation_in_id', p_participation_in_id);
649: --
650: hr_Utility.Set_Location(l_proc, 20);
651: dbms_sql.define_column(l_sql_cursor, 1, p_business_group_id); -- Step 4
647: dbms_sql.bind_variable(l_sql_cursor, -- Step 3
648: ':p_participation_in_id', p_participation_in_id);
649: --
650: hr_Utility.Set_Location(l_proc, 20);
651: dbms_sql.define_column(l_sql_cursor, 1, p_business_group_id); -- Step 4
652: --
653: hr_Utility.Set_Location(l_proc, 30);
654: l_rows := dbms_sql.execute_and_fetch(l_sql_cursor, false); -- Step 5
655: If (l_rows = 0 ) then
650: hr_Utility.Set_Location(l_proc, 20);
651: dbms_sql.define_column(l_sql_cursor, 1, p_business_group_id); -- Step 4
652: --
653: hr_Utility.Set_Location(l_proc, 30);
654: l_rows := dbms_sql.execute_and_fetch(l_sql_cursor, false); -- Step 5
655: If (l_rows = 0 ) then
656: -- if no rows are returned that means the id does not exist
657: -- hence error
658: dbms_sql.close_cursor(l_sql_cursor);
654: l_rows := dbms_sql.execute_and_fetch(l_sql_cursor, false); -- Step 5
655: If (l_rows = 0 ) then
656: -- if no rows are returned that means the id does not exist
657: -- hence error
658: dbms_sql.close_cursor(l_sql_cursor);
659: hr_Utility.set_Location(l_proc, 35);
660: hr_utility.set_message(801,'HR_52069_PAR_INVALID_COLUMN_ID');
661: hr_utility.raise_error;
662: Else
664: --
665: -- Get the column values and close the cursor
666: --
667: hr_Utility.set_Location(l_proc, 40);
668: dbms_sql.column_value(l_sql_cursor, 1, l_business_group_id);
669: dbms_sql.close_cursor(l_sql_cursor);
670:
671: -- bug 1980440 fix starts
672: -- do the validation if Cross Business Group profile is not enabled
665: -- Get the column values and close the cursor
666: --
667: hr_Utility.set_Location(l_proc, 40);
668: dbms_sql.column_value(l_sql_cursor, 1, l_business_group_id);
669: dbms_sql.close_cursor(l_sql_cursor);
670:
671: -- bug 1980440 fix starts
672: -- do the validation if Cross Business Group profile is not enabled
673: lv_cross_business_group := fnd_profile.value('HR_CROSS_BUSINESS_GROUP');
698: end if;
699:
700: When Others Then
701: Hr_Utility.Set_Location(l_proc, 50);
702: If (dbms_sql.is_open(l_sql_cursor)) then
703: hr_utility.Set_Location(l_proc, 55);
704: dbms_sql.close_cursor(l_sql_cursor);
705: End If;
706: Raise;
700: When Others Then
701: Hr_Utility.Set_Location(l_proc, 50);
702: If (dbms_sql.is_open(l_sql_cursor)) then
703: hr_utility.Set_Location(l_proc, 55);
704: dbms_sql.close_cursor(l_sql_cursor);
705: End If;
706: Raise;
707: --
708: hr_utility.set_location(l_proc, 55);