DBA Data[Home] [Help]

APPS.BOMPASGR SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 23

|    05/03/94   Julie Maeyama   Update logic                                |
|                                                                           |
+===========================================================================+
-------------------------- bmartorg_assign_rtg_orgid ------------------------
NAME
    bmartorg_assign_rtg_orgid - assign organization_id to all routing tables
DESCRIPTION
    assign org id to all routing and its child tables

REQUIRES
    err_text 	out buffer to return error message
MODIFIES
    BOM_OP_ROUTINGS_INTERFACE
    BOM_OP_SEQUENCES_INTERFACE
    BOM_OP_RESOURCES_INTERFACE
    MTL_RTG_ITEM_REVS_INTERFACE
    MTL_INTERFACE_ERRORS
RETURNS
    0 if successful
    SQLCODE if unsuccessful
NOTES
----------------------------------------------------------------------------*/
FUNCTION bmartorg_assign_rtg_orgid (
    err_text	IN OUT 	VARCHAR2
)
    return INTEGER

IS
    stmt_num            NUMBER;
Line: 55

    update bom_op_routings_interface ori
	set organization_id = (select organization_id from
	    mtl_parameters a
	    where a.organization_code = ori.organization_code)
    where process_flag = 1
    and   organization_id is null
    and   organization_code is not null
    and   exists (select organization_code
		    from mtl_parameters b
 		   where b.organization_code = ori.organization_code)
    and   rownum < 2000;
Line: 73

    update bom_op_sequences_interface ori
	set organization_id = (select organization_id from
	    mtl_parameters a
	    where a.organization_code = ori.organization_code)
    where process_flag = 1
    and   organization_id is null
    and   organization_code is not null
    and   exists (select organization_code
                    from mtl_parameters b
                   where b.organization_code = ori.organization_code)
    and   rownum < 2000;
Line: 91

    update bom_op_resources_interface ori
	set organization_id = (select organization_id from
	    mtl_parameters a
	    where a.organization_code = ori.organization_code)
    where process_flag = 1
    and   organization_id is null
    and   organization_code is not null
    and   exists (select organization_code
                    from mtl_parameters b
                   where b.organization_code = ori.organization_code)
    and   rownum < 2000;
Line: 109

    update mtl_rtg_item_revs_interface ori
	set organization_id = (select organization_id from
	    mtl_parameters a
	    where a.organization_code = ori.organization_code)
    where process_flag = 1
    and   organization_id is null
    and   organization_code is not null
    and   exists (select organization_code
                    from mtl_parameters b
                   where b.organization_code = ori.organization_code)
    and   rownum < 2000;
Line: 138

    inserts record into MTL_INTERFACE_ERRORS.

REQUIRES
    err_text 	out buffer to return error message
MODIFIES
    MTL_RTG_ITEM_REVS_INTERFACE
    MTL_INTERFACE_ERRORS
RETURNS
    0 if successful
    SQLCODE if unsuccessful
NOTES
-----------------------------------------------------------------------------*/
FUNCTION bmasrrev_assign_rtg_revision (
    org_id		NUMBER,
    all_org		NUMBER,
    user_id		NUMBER,
    login_id		NUMBER,
    prog_appid		NUMBER,
    prog_id		NUMBER,
    req_id		NUMBER,
    err_text  IN OUT 	VARCHAR2
)
    return INTEGER

IS
    stmt_num 	NUMBER := 0;
Line: 168

	select organization_code OC, organization_id OI,
                process_revision PR,
		inventory_item_id III, inventory_item_number IIN,
		transaction_id TI, change_notice CN, ecn_initiation_date CID,
                implementation_date ID, effectivity_date ED
	from mtl_rtg_item_revs_interface
	where process_flag = 1
	and   (all_org = 1
		or
		(all_org = 2 and organization_id = org_id)
	      )
	and rownum < 500;
Line: 186

    update mtl_rtg_item_revs_interface
	set transaction_id = mtl_system_items_interface_s.nextval
    where transaction_id is null
    and   process_flag = 1
    and   rownum < 500;
Line: 214

	    update mtl_rtg_item_revs_interface set
		    process_flag = 3
	    where transaction_id = c1rec.TI;
Line: 243

		update mtl_rtg_item_revs_interface set
		    process_flag = 3
		where transaction_id = c1rec.TI;
Line: 256

	update mtl_rtg_item_revs_interface set
	    organization_id = nvl(organization_id, c1rec.OI),
	    inventory_item_id = nvl(inventory_item_id, c1rec.III),
            process_revision = UPPER(c1rec.PR),
	    process_flag = 2,
	    last_update_date = nvl(last_update_date, sysdate),
	    last_updated_by = nvl(last_updated_by, user_id),
	    creation_date = nvl(creation_date, sysdate),
	    created_by = nvl(created_by, user_id),
	    last_update_login = nvl(last_update_login, user_id),
            request_id = nvl(request_id, req_id),
            program_application_id = nvl(program_application_id, prog_appid),
            program_id = nvl(program_id, prog_id),
            program_update_date = nvl(program_update_date, sysdate),
	    effectivity_date = nvl(effectivity_date, sysdate),
	    IMPLEMENTATION_DATE = nvl(effectivity_date, sysdate)
	where transaction_id = c1rec.TI;
Line: 305

    inserts record into MTL_INTERFACE_ERRORS.

REQUIRES
    err_text 	out buffer to return error message
MODIFIES
    BOM_OP_ROUTINGS_INTERFACE
    MTL_INTERFACE_ERRORS
RETURNS
    0 if successful
    SQLCODE if unsuccessful
NOTES
-----------------------------------------------------------------------------*/
FUNCTION bmprtgh_assign_rtg_header (
    org_id		NUMBER,
    all_org		NUMBER,
    user_id		NUMBER,
    login_id		NUMBER,
    prog_appid		NUMBER,
    prog_id		NUMBER,
    req_id		NUMBER,
    err_text	IN OUT 	VARCHAR2
)
    return INTEGER

IS

    stmt_num		NUMBER;
Line: 343

    cursor c1 is select
	organization_id OI, organization_code OC,
	assembly_item_id AII, assembly_item_number AIN,
	completion_locator_id CLI, location_name LN,
	common_assembly_item_id CAII, common_item_number CAIN,
        common_routing_sequence_id CRSI,
	alternate_routing_designator ARD, transaction_id TI,
	routing_sequence_id RSI, process_revision PR,
	creation_date CD, created_by CB, last_update_login LUL,
	last_update_date LUD, last_updated_by LUB
	from bom_op_routings_interface
	where process_flag = 1
	and   (all_org = 1
		or
		(all_org = 2 and organization_id = org_id)
	      )
	and rownum < 500;
Line: 361

    cursor c2 is select
	transaction_id TI, common_routing_sequence_id CRSI,
	assembly_item_id AII, routing_sequence_id RSI,
	common_assembly_item_id CAID, organization_id OI,
	alternate_routing_designator ARD
	from bom_op_routings_interface
	where process_flag = 99
	and   (all_org = 1
		or
		(all_org = 2 and organization_id = org_id)
	      )
	and rownum < 500;
Line: 380

    update bom_op_routings_interface ori
	set transaction_id = mtl_system_items_interface_s.nextval,
	    routing_sequence_id = nvl(routing_sequence_id,
			bom_operational_routings_s.nextval)
    where transaction_id is null
    and   process_flag = 1
    and   rownum < 500;
Line: 410

	    update bom_op_routings_interface set
		    process_flag = 3
	    where transaction_id = c1rec.TI;
Line: 442

		update bom_op_routings_interface set
		    process_flag = 3
		where transaction_id = c1rec.TI;
Line: 478

		update bom_op_routings_interface set
		    process_flag = 3
		where transaction_id = c1rec.TI;
Line: 515

		update bom_op_routings_interface set
		    process_flag = 3
		where transaction_id = c1rec.TI;
Line: 526

** insert given process_revision
*/
        if (c1rec.PR is not null) then
            insert into mtl_rtg_item_revs_interface
                   (organization_id,
		    inventory_item_id,
		    process_revision,
                    process_flag,
		    last_update_date,
		    last_updated_by,
                    creation_date,
		    created_by,
		    last_update_login,
		    request_id,
		    program_application_id,
		    program_id,
		    program_update_date,
		    effectivity_date,
                    IMPLEMENTATION_DATE,
		    transaction_id)
            values (c1rec.OI,
		    c1rec.AII,
		    UPPER(c1rec.PR),
		    2,
		    nvl(c1rec.LUD,sysdate),
		    nvl(c1rec.LUB,user_id),
                    nvl(c1rec.CD,sysdate),
		    nvl(c1rec.CB,user_id),
                    nvl(c1rec.LUL, user_id),
                    req_id,
                    prog_appid,
                    prog_id,
                    sysdate,
		    sysdate,
	 	    sysdate,
		    mtl_system_items_interface_s.nextval);
Line: 562

	    goto update_rtg;
Line: 564

	    select starting_revision into c1rec.PR
		from mtl_parameters
		where organization_id = c1rec.OI;
Line: 573

	select count(process_revision) into revs_int
	  from    mtl_rtg_item_revs_interface
  	 where organization_id = c1rec.OI
	   and inventory_item_id = c1rec.AII
           and process_flag <> 3 and process_flag <> 7;
Line: 582

        select count(process_revision) into revs_prod
          from    mtl_rtg_item_revisions
         where organization_id = c1rec.OI
           and inventory_item_id = c1rec.AII;
Line: 589

** insert a record into the revs interface table because one does not exist
*/
	if (revs = 0) then
	    insert into mtl_rtg_item_revs_interface
                   (organization_id,
		    inventory_item_id,
		    process_revision,
		    process_flag,
		    last_update_date,
		    last_updated_by,
 		    creation_date,
		    created_by,
		    last_update_login,
		    request_id,
		    program_application_id,
		    program_id,
		    program_update_date,
		    effectivity_date,
                    IMPLEMENTATION_DATE,
		    transaction_id)
	    values (c1rec.OI,
		    c1rec.AII,
		    c1rec.PR,
		    2,
		    nvl(c1rec.LUD, sysdate),
		    nvl(c1rec.LUB, user_id),
                    nvl(c1rec.CD, sysdate),
		    nvl(c1rec.CB, user_id),
		    nvl(c1rec.LUL, user_id),
		    req_id,
                    prog_appid,
                    prog_id,
                    sysdate,
		    sysdate,
		    sysdate,
		    mtl_system_items_interface_s.nextval);
Line: 628

** update bom_op_routings_interface with the modified column values
*/
<>
	stmt_num := 6;
Line: 632

	update bom_op_routings_interface
	set organization_id = nvl(organization_id, c1rec.OI),
	    assembly_item_id = nvl(assembly_item_id, c1rec.AII),
	    completion_locator_id = nvl(completion_locator_id, c1rec.CLI),
	    common_assembly_item_id = nvl(common_assembly_item_id, c1rec.CAII),
	    routing_type = nvl(routing_type, 1),
	    last_update_date = nvl(last_update_date, sysdate),
	    last_updated_by = nvl(last_updated_by, user_id),
	    creation_date = nvl(creation_date, sysdate),
	    created_by = nvl(created_by, user_id),
            last_update_login = nvl(last_update_login, user_id),
            request_id = nvl(request_id, req_id),
            program_application_id = nvl(program_application_id, prog_appid),
            program_id = nvl(program_id, prog_id),
            program_update_date = nvl(program_update_date, sysdate),
	    process_flag = 99
	where transaction_id = c1rec.TI;
Line: 755

        update bom_op_routings_interface set
	    process_flag = proc_flag,
	    common_routing_sequence_id = c2rec.CRSI,
            common_assembly_item_id = assy_id
        where transaction_id = c2rec.TI;
Line: 788

    inserts record into MTL_INTERFACE_ERRORS.

REQUIRES
    err_text 	out buffer to return error message
MODIFIES
    BOM_OP_SEQUENCES_INTERFACE
    MTL_INTERFACE_ERRORS
RETURNS
    0 if successful
    SQLCODE if unsuccessful
NOTES
-----------------------------------------------------------------------------*/
FUNCTION bmasopd_assign_operation_data (
    org_id		NUMBER,
    all_org		NUMBER,
    user_id		NUMBER,
    login_id		NUMBER,
    prog_appid		NUMBER,
    prog_id		NUMBER,
    req_id		NUMBER,
    err_text  IN OUT 	VARCHAR2
)
    return INTEGER

IS
    stmt_num 	NUMBER := 0;
Line: 840

	select organization_code OC, organization_id OI,
	        operation_sequence_id OSI,
		assembly_item_id AII, assembly_item_number AIN,
		alternate_routing_designator ARD, routing_sequence_id RSI,
		department_id DI, department_code DC,
		operation_code SOC, standard_operation_id SOI,
		transaction_id TI, operation_seq_num OSN,
                to_char(effectivity_date,'YYYY/MM/DD HH24:MI:SS') ED,  -- Changed for bug 2647027
--		to_char(effectivity_date,'YYYY/MM/DD HH24:MI') ED,
 		minimum_transfer_quantity MTQ, count_point_type CPT,
                operation_description OD, backflush_flag BF,
		option_dependent_flag ODF, attribute_category AC,
                attribute1 A1, attribute1 A2, attribute1 A3,
		attribute1 A4,attribute1 A5,attribute1 A6,attribute1 A7,
		attribute1 A8,attribute1 A9,attribute1 A10,attribute1 A11,
		attribute1 A12,attribute1 A13,attribute1 A14,attribute1 A15
	from bom_op_sequences_interface
	where process_flag = 1
	and   (all_org = 1
		or
		(all_org = 2 and organization_id = org_id)
	      )
	and rownum < 500;
Line: 872

    update bom_op_sequences_interface
	set transaction_id = mtl_system_items_interface_s.nextval,
	    operation_sequence_id = nvl(operation_sequence_id,
			bom_operation_sequences_s.nextval)
    where transaction_id is null
    and   process_flag = 1
    and   rownum < 500;
Line: 904

	    update bom_op_sequences_interface set
		    process_flag = 3
	    where transaction_id = c1rec.TI;
Line: 925

            update bom_op_sequences_interface set
                    process_flag = 3
            where transaction_id = c1rec.TI;
Line: 955

		update bom_op_sequences_interface set
		    process_flag = 3
		where transaction_id = c1rec.TI;
Line: 987

		update bom_op_sequences_interface set
		    process_flag = 3
		where transaction_id = c1rec.TI;
Line: 1016

                update bom_op_sequences_interface set
                    process_flag = 3
                where transaction_id = c1rec.TI;
Line: 1047

		update bom_op_sequences_interface set
		    process_flag = 3
		where transaction_id = c1rec.TI;
Line: 1078

		update bom_op_sequences_interface set
		    process_flag = 3
		where transaction_id = c1rec.TI;
Line: 1095

           select DEPARTMENT_ID, MINIMUM_TRANSFER_QUANTITY,
                  COUNT_POINT_TYPE, OPERATION_DESCRIPTION,
		  BACKFLUSH_FLAG, OPTION_DEPENDENT_FLAG,
		  ATTRIBUTE_CATEGORY, ATTRIBUTE1, ATTRIBUTE2,ATTRIBUTE3,
		  ATTRIBUTE4, ATTRIBUTE5, ATTRIBUTE6, ATTRIBUTE7,
		  ATTRIBUTE8, ATTRIBUTE9, ATTRIBUTE10, ATTRIBUTE11,
		  ATTRIBUTE12, ATTRIBUTE13, ATTRIBUTE14, ATTRIBUTE15
             into std_dept_id, std_min_qty, std_cnt_pt, std_desc,
                  std_bkflsh, std_opt, std_attcat, std_att1, std_att2,
		  std_att3, std_att4, std_att5, std_att6, std_att7,
		  std_att8, std_att9, std_att10, std_att11, std_att12,
		  std_att13, std_att14, std_att15
             from bom_standard_operations
            where organization_id = c1rec.OI
              and standard_operation_id = c1rec.SOI;
Line: 1124

                update bom_op_sequences_interface set
                    process_flag = 3
                where transaction_id = c1rec.TI;
Line: 1226

	update bom_op_sequences_interface set
	    department_id = nvl(department_id, c1rec.DI),
	    organization_id = nvl(organization_id, c1rec.OI),
	    assembly_item_id = nvl(assembly_item_id, c1rec.AII),
	    process_flag = 2,
	    standard_operation_id = nvl(standard_operation_id,c1rec.SOI),
	    routing_sequence_id = nvl(routing_sequence_id, c1rec.RSI),
	    operation_sequence_id = nvl(operation_sequence_id, c1rec.OSI),
	    last_update_date = nvl(last_update_date, sysdate),
	    last_updated_by = nvl(last_updated_by, user_id),
	    creation_date = nvl(creation_date, sysdate),
	    created_by = nvl(created_by, user_id),
            last_update_login = nvl(last_update_login, user_id),
            request_id = nvl(request_id, req_id),
            program_application_id = nvl(program_application_id, prog_appid),
            program_id = nvl(program_id, prog_id),
            program_update_date = nvl(program_update_date, sysdate),
	    backflush_flag = nvl(backflush_flag, nvl(c1rec.BF,1)),
            count_point_type = nvl(count_point_type,nvl(c1rec.CPT, 1)),
            operation_description = nvl(operation_description,
                nvl(c1rec.OD,NULL)),
            option_dependent_flag =nvl(option_dependent_flag,nvl(c1rec.ODF,2)),
	    minimum_transfer_quantity = nvl(minimum_transfer_quantity,
                nvl(c1rec.MTQ, 0.00)),
	    attribute_category = nvl(attribute_category,nvl(c1rec.AC,NULL)),
	    attribute1 = nvl(attribute1, nvl(c1rec.A1, NULL)),
            attribute2 = nvl(attribute2, nvl(c1rec.A2, NULL)),
            attribute3 = nvl(attribute3, nvl(c1rec.A3, NULL)),
            attribute4 = nvl(attribute4, nvl(c1rec.A4, NULL)),
            attribute5 = nvl(attribute5, nvl(c1rec.A5, NULL)),
            attribute6 = nvl(attribute6, nvl(c1rec.A6, NULL)),
            attribute7 = nvl(attribute7, nvl(c1rec.A7, NULL)),
            attribute8 = nvl(attribute8, nvl(c1rec.A8, NULL)),
            attribute9 = nvl(attribute9, nvl(c1rec.A9, NULL)),
            attribute10 = nvl(attribute10, nvl(c1rec.A10, NULL)),
            attribute11 = nvl(attribute11, nvl(c1rec.A11, NULL)),
            attribute12 = nvl(attribute12, nvl(c1rec.A12, NULL)),
            attribute13 = nvl(attribute13, nvl(c1rec.A13, NULL)),
            attribute14 = nvl(attribute14, nvl(c1rec.A14, NULL)),
            attribute15 = nvl(attribute15, nvl(c1rec.A15, NULL))
	where transaction_id = c1rec.TI;
Line: 1276

    insert into bom_op_resources_interface (
        OPERATION_SEQUENCE_ID,
        RESOURCE_SEQ_NUM,
        RESOURCE_ID,
        ACTIVITY_ID,
        STANDARD_RATE_FLAG,
        ASSIGNED_UNITS,
        USAGE_RATE_OR_AMOUNT,
        USAGE_RATE_OR_AMOUNT_INVERSE,
        BASIS_TYPE,
        SCHEDULE_FLAG,
        AUTOCHARGE_TYPE,
        ATTRIBUTE_CATEGORY,
        ATTRIBUTE1,
        ATTRIBUTE2,
        ATTRIBUTE3,
        ATTRIBUTE4,
        ATTRIBUTE5,
        ATTRIBUTE6,
        ATTRIBUTE7,
        ATTRIBUTE8,
        ATTRIBUTE9,
        ATTRIBUTE10,
        ATTRIBUTE11,
        ATTRIBUTE12,
        ATTRIBUTE13,
        ATTRIBUTE14,
        ATTRIBUTE15,
        ASSEMBLY_ITEM_ID,
        ALTERNATE_ROUTING_DESIGNATOR,
        ORGANIZATION_ID,
        OPERATION_SEQ_NUM,
        EFFECTIVITY_DATE,
        ROUTING_SEQUENCE_ID,
        ORGANIZATION_CODE,
        ASSEMBLY_ITEM_NUMBER,
        RESOURCE_CODE,
        ACTIVITY,
        TRANSACTION_ID,
        PROCESS_FLAG) select
        c1rec.OSI,
        RESOURCE_SEQ_NUM,
        RESOURCE_ID,
        ACTIVITY_ID,
        STANDARD_RATE_FLAG,
        ASSIGNED_UNITS,
        USAGE_RATE_OR_AMOUNT,
        USAGE_RATE_OR_AMOUNT_INVERSE,
        BASIS_TYPE,
        SCHEDULE_FLAG,
        AUTOCHARGE_TYPE,
        ATTRIBUTE_CATEGORY,
        ATTRIBUTE1,
        ATTRIBUTE2,
        ATTRIBUTE3,
        ATTRIBUTE4,
        ATTRIBUTE5,
        ATTRIBUTE6,
        ATTRIBUTE7,
        ATTRIBUTE8,
        ATTRIBUTE9,
        ATTRIBUTE10,
        ATTRIBUTE11,
        ATTRIBUTE12,
        ATTRIBUTE13,
        ATTRIBUTE14,
        ATTRIBUTE15,
        NULL,
        NULL,
        c1rec.OI,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        1
        from bom_std_op_resources
        where standard_operation_id = c1rec.SOI;
Line: 1398

    inserts record into MTL_INTERFACE_ERRORS.

REQUIRES
    err_text 	out buffer to return error message
MODIFIES
    BOM_OP_RESOURCES_INTERFACE
    MTL_INTERFACE_ERRORS
RETURNS
    0 if successful
    SQLCODE if unsuccessful
NOTES
-----------------------------------------------------------------------------*/
FUNCTION bmasrsd_assign_resource_data (
    org_id		NUMBER,
    all_org		NUMBER,
    user_id		NUMBER,
    login_id		NUMBER,
    prog_appid		NUMBER,
    prog_id		NUMBER,
    req_id		NUMBER,
    err_text	IN OUT 	VARCHAR2
)
    return INTEGER
IS
    stmt_num 	NUMBER := 0;
Line: 1434

	select  operation_sequence_id OSI,assembly_item_number AIN,
		assembly_item_id AII, organization_id OI,
		organization_code OC,
		alternate_routing_designator ARD, operation_seq_num OSN,
		to_char(effectivity_date, 'YYYY/MM/DD HH24:MI:SS') ED,  -- Changed for bug 2647027
--		to_char(effectivity_date, 'YYYY/MM/DD HH24:MI') ED,
                routing_sequence_id RSI,
		transaction_id TI
	from bom_op_resources_interface
	where process_flag = 1
        and   operation_sequence_id is null
	and   (all_org = 1
		or
		(all_org = 2 and organization_id = org_id)
	      )
	and rownum < 500;
Line: 1452

	select transaction_id TI, organization_id OI,
               operation_sequence_id OSI, resource_id RI, resource_code RC,
 	       activity_id AI, activity A, usage_rate_or_amount URA,
               usage_rate_or_amount_inverse URAI, assigned_units AU,
               basis_type BT, autocharge_type AUT, standard_rate_flag SRF
	from bom_op_Resources_interface
	where process_flag = 1
        and   operation_sequence_id is not null
	and   (all_org = 1
		or
		(all_org = 2 and organization_id = org_id)
	      )
	and rownum < 500;
Line: 1467

        select operation_sequence_id OSI
        from bom_op_Resources_interface
        where process_flag = 99
        and   (all_org = 1
                or
                (all_org = 2 and organization_id = org_id)
              )
	and rownum < 500
        group by operation_sequence_id;
Line: 1482

    insert into bom_op_resources_interface (
	OPERATION_SEQUENCE_ID,
	RESOURCE_SEQ_NUM,
	RESOURCE_ID,
	RESOURCE_CODE,
	ORGANIZATION_ID,
	PROCESS_FLAG,
	LAST_UPDATE_DATE,
	LAST_UPDATED_BY,
	CREATION_DATE,
	CREATED_BY) select
	operation_sequence_id,
	10,
	resource_id1,
	resource_code1,
	organization_id,
	1,
	sysdate,
	user_id,
	sysdate,
	user_id
	from bom_op_sequences_interface
    	where process_flag = 2
	and   (all_org = 1
		or
		(all_org = 2 and organization_id = org_id)
	      )
	and (resource_id1 is not null or resource_code1 is not null);
Line: 1513

    insert into bom_op_resources_interface (
	OPERATION_SEQUENCE_ID,
	RESOURCE_SEQ_NUM,
	RESOURCE_ID,
	RESOURCE_CODE,
	ORGANIZATION_ID,
	PROCESS_FLAG,
	LAST_UPDATE_DATE,
	LAST_UPDATED_BY,
	CREATION_DATE,
	CREATED_BY) select
	operation_sequence_id,
	20,
	resource_id2,
	resource_code2,
	organization_id,
	1,
	sysdate,
	user_id,
	sysdate,
	user_id
	from bom_op_sequences_interface
    	where process_flag = 2
	and   (all_org = 1
		or
		(all_org = 2 and organization_id = org_id)
	      )
	and (resource_id2 is not null or resource_code2 is not null);
Line: 1544

    insert into bom_op_resources_interface (
	OPERATION_SEQUENCE_ID,
	RESOURCE_SEQ_NUM,
	RESOURCE_ID,
	RESOURCE_CODE,
	ORGANIZATION_ID,
	PROCESS_FLAG,
	LAST_UPDATE_DATE,
	LAST_UPDATED_BY,
	CREATION_DATE,
	CREATED_BY) select
	operation_sequence_id,
	30,
	resource_id3,
	resource_code3,
	organization_id,
	1,
	sysdate,
	user_id,
	sysdate,
	user_id
	from bom_op_sequences_interface
    	where process_flag = 2
	and   (all_org = 1
		or
		(all_org = 2 and organization_id = org_id)
	      )
	and (resource_id3 is not null or resource_code3 is not null);
Line: 1578

    update bom_op_resources_interface
       set transaction_id = mtl_system_items_interface_s.nextval
      where transaction_id is null
        and process_flag = 1
    and   rownum < 500;
Line: 1608

            update bom_op_resources_interface set
                    process_flag = 3
            where transaction_id = c1rec.TI;
Line: 1643

                update bom_op_resources_interface set
                    process_flag = 3
                where transaction_id = c1rec.TI;
Line: 1678

            update bom_op_resources_interface set
                   process_flag = 3
             where transaction_id = c1rec.TI;
Line: 1712

            update bom_op_resources_interface set
                    process_flag = 3
             where transaction_id = c1rec.TI;
Line: 1723

        update bom_op_resources_interface
           set operation_sequence_id = c1rec.OSI,
               assembly_item_id = c1rec.AII,
               routing_sequence_id = c1rec.RSI
         where transaction_id = c1rec.TI;
Line: 1751

        select bor.organization_id
          into dummy_org_id
          from bom_operation_sequences bos,
               bom_operational_routings bor
         where operation_sequence_id = c2rec.OSI
           and bos.routing_sequence_id = bor.routing_sequence_id;
Line: 1764

        select bori.organization_id
          into dummy_org_id
          from bom_op_sequences_interface bosi,
               bom_op_routings_interface bori
         where operation_sequence_id = c2rec.OSI
           and bosi.process_flag <>3 and bosi.process_flag <>7
           and bori.process_flag <>3 and bori.process_flag <>7
           and bosi.routing_sequence_id = bori.routing_sequence_id
           and rownum = 1;
Line: 1780

        select bor.organization_id
          into dummy_org_id
          from bom_op_sequences_interface bosi,
               bom_operational_routings bor
         where operation_sequence_id = c2rec.OSI
           and bosi.process_flag <> 3 and bosi.process_flag <> 7
           and bosi.routing_sequence_id = bor.routing_sequence_id
	   and rownum = 1;
Line: 1803

            update bom_op_resources_interface set
                    process_flag = 3
            where transaction_id = c2rec.TI;
Line: 1823

              select resource_id
                into c2rec.RI
                from bom_resources
               where resource_code = c2rec.RC
                 and organization_id = c2rec.OI;
Line: 1842

                   update bom_op_resources_interface set
                       process_flag = 3
                    where transaction_id = c2rec.TI;
Line: 1858

              select activity_id
                into c2rec.AI
                from cst_activities
               where activity = c2rec.A
                 and nvl(organization_id,c2rec.OI) = c2rec.OI;
Line: 1877

                   update bom_op_resources_interface set
                       process_flag = 3
                    where transaction_id = c2rec.TI;
Line: 1916

           select department_id
             into dummy_dept
             from bom_operation_sequences
            where operation_sequence_id = c2rec.OSI;
Line: 1927

           select department_id
             into dummy_dept
             from bom_op_sequences_interface
            where operation_sequence_id = c2rec.OSI
              and process_flag <>3 and process_flag <> 7
              and rownum = 1;
Line: 1948

                   update bom_op_resources_interface set
                       process_flag = 3
                    where transaction_id = c2rec.TI;
Line: 1961

           select bdr.AVAILABLE_24_HOURS_FLAG, bd.location_id
             into dummy_24hours, dummy_loc
             from bom_department_resources bdr,
                  bom_departments bd
            where bdr.resource_id = c2rec.RI
              and bdr.department_id = dummy_dept
              and bdr.department_id = bd.department_id;
Line: 1987

                   update bom_op_resources_interface set
                       process_flag = 3
                    where transaction_id = c2rec.TI;
Line: 2001

        select nvl(c2rec.BT,default_basis_type),
	       nvl(c2rec.AI, default_activity_id),
               nvl(c2rec.AUT,decode(dummy_loc, NULL,
                 decode(AUTOCHARGE_TYPE, NULL, 2, 3, 2, 4, 2,
                 AUTOCHARGE_TYPE), nvl(AUTOCHARGE_TYPE, 2))),
               nvl(c2rec.SRF, standard_rate_flag)
          into c2rec.BT, c2rec.AI, c2rec.AUT, c2rec.SRF
          from bom_resources
         where resource_id = c2rec.RI;
Line: 2012

	update bom_op_resources_interface set
		resource_id = c2rec.RI,
		organization_id = c2rec.OI,
                BASIS_TYPE = nvl(c2rec.BT,1),
		AUTOCHARGE_TYPE = c2rec.AUT,
                ACTIVITY_ID = c2rec.AI,
		STANDARD_RATE_FLAG = nvl(c2rec.SRF, 1),
	    	ASSIGNED_UNITS = c2rec.AU,
		USAGE_RATE_OR_AMOUNT = nvl(c2rec.URA,1),
		USAGE_RATE_OR_AMOUNT_INVERSE = nvl(c2rec.URAI,1),
		SCHEDULE_FLAG = nvl(schedule_flag, 2),
		PROCESS_FLAG = 99,
		last_update_date = sysdate,
		last_updated_by = user_id,
		creation_date = sysdate,
	 	created_by = user_id,
                last_update_login = nvl(last_update_login, user_id),
                request_id = nvl(request_id, req_id),
              program_application_id = nvl(program_application_id, prog_appid),
                program_id = nvl(program_id, prog_id),
                program_update_date = nvl(program_update_date, sysdate)
	where transaction_id = c2rec.TI;
Line: 2051

select count(distinct operation_sequence_id)
  into total_recs
  from bom_op_resources_interface
 where process_flag = 99;
Line: 2062

        select mtl_system_items_interface_s.nextval
          into dummy_txn
          from sys.dual;
Line: 2066

        update bom_op_resources_interface
           set transaction_id = dummy_txn,
               process_flag = 2
         where operation_sequence_id = c3rec.OSI
           and process_flag = 99;
Line: 2124

        select routing_sequence_id
	into rtg_seq_id
	from bom_operational_routings
	where organization_id = org_id
	and   assembly_item_id = item_id
	and   nvl(alternate_routing_designator, 'NONE') =
		nvl(alt_desg, 'NONE');
Line: 2141

    select routing_sequence_id
	into rtg_seq_id
	from bom_op_routings_interface
	where organization_id = org_id
	and assembly_item_id  = item_id
	and nvl(alternate_routing_designator, 'NONE') =
	    nvl(alt_desg, 'NONE')
        and process_flag <> 3 and process_flag <> 7
        and rownum = 1;
Line: 2194

        select operation_sequence_id
        into op_seq_id
        from bom_operation_sequences
        where routing_sequence_id = rtg_seq_id
        and   operation_seq_num = op_seq
        and   to_char(effectivity_date,'YYYY/MM/DD HH24:MI:SS') = eff_date;  -- Changed for bug 2647027
Line: 2210

    select operation_sequence_id
        into op_seq_id
        from bom_op_sequences_interface
        where routing_sequence_id = rtg_seq_id
        and   operation_seq_num = op_seq
        and   to_char(effectivity_date,'YYYY/MM/DD HH24:MI:SS') = eff_date  -- Changed for bug 2647027
--      and   to_char(effectivity_date,'YYYY/MM/DD HH24:MI') = eff_date
        and   process_flag <> 3 and process_flag <> 7
        and   rownum = 1;
Line: 2270

    update bom_op_resources_interface set
	operation_sequence_id = op_id
    where process_flag = 1
    and   organization_id = org_id
    and   assembly_item_id = assy_id
    and   nvl(alternate_routing_designator, 'NONE') =
		nvl(alt_desg, 'NONE')
    and   operation_seq_num = op_seq
    and   to_char(effectivity_date,'YYYY/MM/DD HH24:MI:SS') = eff_date  -- Changed for bug 2647027
--  and   to_char(effectivity_date,'YYYY/MM/DD HH24:MI') = eff_date
    and   operation_sequence_id is null
    and   rownum < 500;
Line: 2326

    update bom_op_sequences_interface set
	routing_sequence_id = rtg_id
    where process_flag = 1
    and   organization_id = org_id
    and   assembly_item_id = assy_id
    and   nvl(alternate_routing_designator, 'NONE') =
		nvl(alt_desg, 'NONE')
    and   routing_sequence_id is null
    and   rownum < 500;
Line: 2341

    update bom_op_resources_interface set
	routing_sequence_id = rtg_id
    where process_flag = 1
    and   organization_id = org_id
    and   assembly_item_id = assy_id
    and   nvl(alternate_routing_designator, 'NONE') =
		nvl(alt_desg, 'NONE')
    and   routing_sequence_id is null
    and   rownum < 500;
Line: 2393

        select assembly_item_id, organization_id, alternate_routing_designator
        into item_id, org_id, alt_desg
        from bom_operational_routings
        where routing_sequence_id = rtg_seq_id;
Line: 2406

    select assembly_item_id, organization_id, alternate_routing_designator
        into item_id, org_id, alt_desg
        from bom_op_routings_interface
        where routing_sequence_id = rtg_seq_id
          and process_flag <> 3 and process_flag <> 7
	  and rownum = 1;
Line: 2453

    select department_id
	into dept_id
	from bom_departments
	where organization_id = org_id
	and   department_code = dept_code;
Line: 2492

    select standard_operation_id
	into stdop_id
	from bom_Standard_operations
	where organization_id = org_id
	and  operation_code = stdop_code;
Line: 2530

    Select bos.rowid row_id
    From bom_op_sequences_interface bos
    where bos.process_flag = 1
    and   bos.assembly_item_id is null
    and   bos.organization_id = org_id
    and   bos.assembly_item_number = item_num
    and   bos.routing_sequence_id is null;
Line: 2538

    Select bor.rowid row_id
    From bom_op_resources_interface bor
    where bor.process_flag = 1
    and   bor.assembly_item_id is null
    and   bor.organization_id = org_id
    and   bor.assembly_item_number = item_num
    and   bor.routing_sequence_id is null;
Line: 2548

      update bom_op_sequences_interface
	set assembly_item_id = item_id
      where rowid = X_Operation.row_id;
Line: 2560

      update bom_op_resources_interface
	set assembly_item_id = item_id
      where rowid = X_Resource.row_id;