150:
151: /*-------------------------------------------------------------------------------*/
152: /* procedure name: insert_rep_typ_sar */
153: /* description : procedure for inserting Material , Labor and Expense SAR */
154: /* data into CSD_REPAIR_TYPES_SAR table in 11.5.9 */
155: /*-------------------------------------------------------------------------------*/
156: PROCEDURE insert_rep_typ_sar( p_repair_type_id IN NUMBER
157: ,p_txn_billing_type_id IN NUMBER
158: ,p_created_by IN NUMBER
165: BEGIN
166:
167: begin
168:
169: -- check if the repair type and billing txn type id not yet inserted into CSD_REPAIR_TYPES_SAR
170: select count(*)
171: into l_count
172: from CSD_REPAIR_TYPES_SAR
173: where REPAIR_TYPE_ID = p_repair_type_id
168:
169: -- check if the repair type and billing txn type id not yet inserted into CSD_REPAIR_TYPES_SAR
170: select count(*)
171: into l_count
172: from CSD_REPAIR_TYPES_SAR
173: where REPAIR_TYPE_ID = p_repair_type_id
174: and TXN_BILLING_TYPE_ID = p_txn_billing_type_id;
175: exception
176: WHEN OTHERS THEN
183: SAVEPOINT REPAIR_TYPES_SAR;
184:
185: BEGIN
186:
187: -- inserted into CSD_REPAIR_TYPES_SAR
188: insert into CSD_REPAIR_TYPES_SAR
189: ( REPAIR_TXN_BILLING_TYPE_ID
190: ,REPAIR_TYPE_ID
191: ,TXN_BILLING_TYPE_ID
184:
185: BEGIN
186:
187: -- inserted into CSD_REPAIR_TYPES_SAR
188: insert into CSD_REPAIR_TYPES_SAR
189: ( REPAIR_TXN_BILLING_TYPE_ID
190: ,REPAIR_TYPE_ID
191: ,TXN_BILLING_TYPE_ID
192: ,CREATED_BY
194: ,LAST_UPDATED_BY
195: ,LAST_UPDATE_DATE
196: ,OBJECT_VERSION_NUMBER
197: ) VALUES
198: ( CSD_REPAIR_TYPES_SAR_S1.NEXTVAL
199: ,p_repair_type_id
200: ,p_txn_billing_type_id
201: ,p_created_by
202: ,p_creation_date
216: upgrade_datetime,
217: error_message,
218: migration_phase)
219: VALUES ('CS_REPAIR_TYPES_B',
220: 'CSD_REPAIR_TYPES_SAR',
221: p_repair_type_id,
222: sysdate,
223: v_error_text,
224: '11.5.9');
224: '11.5.9');
225:
226: commit;
227:
228: raise_application_error( -20000, 'Error while migrating CSD_REPAIR_TYPES_B table data: Error while inserting into CSD_REPAIR_TYPES_SAR. '|| v_error_text);
229:
230: END;
231:
232: end if;
238: /*-------------------------------------------------------------------------------*/
239: /* procedure name: CSD_REPAIR_TYPES_B_MIG2 */
240: /* description : procedure for migrating Material , Labor and Expense SAR */
241: /* data in CSD_REPAIR_TYPES_B table in 11.5.8 */
242: /* to CSD_REPAIR_TYPES_SAR table in 11.5.9 */
243: /*-------------------------------------------------------------------------------*/
244:
245: PROCEDURE CSD_REPAIR_TYPES_B_MIG2 IS
246:
285: ,l_creation_date;
286:
287: EXIT WHEN csd_repair_types_b_cursor%NOTFOUND;
288:
289: -- check if the repair type and billing txn type id not yet inserted in to CSD_REPAIR_TYPES_SAR
290:
291:
292:
293: if (l_mtl_txn_billing_type_id is not null) then
291:
292:
293: if (l_mtl_txn_billing_type_id is not null) then
294:
295: -- insert into CSD_REPAIR_TYPES_SAR
296: insert_rep_typ_sar( l_repair_type_id
297: ,l_mtl_txn_billing_type_id
298: ,l_created_by
299: ,l_creation_date);
300: end if;
301:
302: if (l_lbr_txn_billing_type_id is not null) then
303:
304: -- insert into CSD_REPAIR_TYPES_SAR
305: insert_rep_typ_sar( l_repair_type_id
306: ,l_lbr_txn_billing_type_id
307: ,l_created_by
308: ,l_creation_date);
309: end if;
310:
311: if (l_exp_txn_billing_type_id is not null) then
312:
313: -- insert into CSD_REPAIR_TYPES_SAR
314: insert_rep_typ_sar( l_repair_type_id
315: ,l_exp_txn_billing_type_id
316: ,l_created_by
317: ,l_creation_date);