1 package body INV_OA_GEN_PVT as
2 /* $Header: INVOAGEB.pls 120.0 2005/06/28 16:26 jxlu noship $ */
3
4 PROCEDURE BUILD_ASSEMBLY_LOT_SERIAL_TBL(
5 x_return_status out nocopy VARCHAR2
6 , x_msg_count out nocopy NUMBER
7 , x_msg_data out nocopy VARCHAR2
8 , p_assembly_lot_serial_tbl assembly_lot_sel_tbl_type
9 ) is
10 begin
11 /*-- Bulk insert the lot and serial records records
12 FORALL i IN 1 .. p_assembly_lot_serial_tbl.COUNT
13 INSERT INTO MTL_ALLOCATIONS_GTMP
14 (Lot_number,
15 serial_number)
16 VALUES
17 (p_assembly_lot_serial_tbl(i).lot_number,
18 p_assembly_lot_serial_tbl(i).serial_number); */
19
20 DELETE MTL_ALLOCATIONS_GTMP;
21
22 FOR i IN 1 .. p_assembly_lot_serial_tbl.COUNT LOOP
23 INSERT INTO MTL_ALLOCATIONS_GTMP
24 (Lot_number,
25 serial_number)
26 VALUES
27 (p_assembly_lot_serial_tbl(i).lot_number,
28 p_assembly_lot_serial_tbl(i).serial_number);
29 END LOOP;
30 end;
31
32 procedure rosetta_table_copy_in_p1(t out nocopy inv_oa_gen_pvt.assembly_lot_sel_tbl_type, a0 JTF_VARCHAR2_TABLE_100
33 , a1 JTF_VARCHAR2_TABLE_100
34 ) as
35 ddindx binary_integer; indx binary_integer;
36 begin
37 if a0 is not null and a0.count > 0 then
38 if a0.count > 0 then
39 indx := a0.first;
40 ddindx := 1;
41 while true loop
42 t(ddindx).lot_number := a0(indx);
43 t(ddindx).serial_number := a1(indx);
44 ddindx := ddindx+1;
45 if a0.last =indx
46 then exit;
47 end if;
48 indx := a0.next(indx);
49 end loop;
50 end if;
51 end if;
52 end rosetta_table_copy_in_p1;
53 procedure rosetta_table_copy_out_p1(t inv_oa_gen_pvt.assembly_lot_sel_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_100
54 , a1 out nocopy JTF_VARCHAR2_TABLE_100
55 ) as
56 ddindx binary_integer; indx binary_integer;
57 begin
58 if t is null or t.count = 0 then
59 a0 := JTF_VARCHAR2_TABLE_100();
60 a1 := JTF_VARCHAR2_TABLE_100();
61 else
62 a0 := JTF_VARCHAR2_TABLE_100();
63 a1 := JTF_VARCHAR2_TABLE_100();
64 if t.count > 0 then
65 a0.extend(t.count);
66 a1.extend(t.count);
67 ddindx := t.first;
68 indx := 1;
69 while true loop
70 a0(indx) := t(ddindx).lot_number;
71 a1(indx) := t(ddindx).serial_number;
72 indx := indx+1;
73 if t.last =ddindx
74 then exit;
75 end if;
76 ddindx := t.next(ddindx);
77 end loop;
78 end if;
79 end if;
80 end rosetta_table_copy_out_p1;
81
82 procedure build_assembly_lot_serial_tbl(x_return_status out nocopy VARCHAR2
83 , x_msg_count out nocopy NUMBER
84 , x_msg_data out nocopy VARCHAR2
85 , p3_a0 JTF_VARCHAR2_TABLE_100
86 , p3_a1 JTF_VARCHAR2_TABLE_100
87 )
88
89 as
90 ddp_assembly_lot_serial_tbl inv_oa_gen_pvt.assembly_lot_sel_tbl_type;
91 ddindx binary_integer; indx binary_integer;
92 begin
93
94 -- copy data to the local IN or IN-OUT args, if any
95
96
97
98 rosetta_table_copy_in_p1(ddp_assembly_lot_serial_tbl, p3_a0
99 , p3_a1
100 );
101
102 -- here's the delegated call to the old PL/SQL routine
103 inv_oa_gen_pvt.build_assembly_lot_serial_tbl(x_return_status,
104 x_msg_count,
105 x_msg_data,
106 ddp_assembly_lot_serial_tbl);
107
108 -- copy data back from the local variables to OUT or IN-OUT args, if any
109
110
111
112 end;
113
114
115 end INV_OA_GEN_PVT;