DBA Data[Home] [Help]

PACKAGE BODY: APPS.FUN_SEQ_W

Source


1 package body fun_seq_w as
2   /* $Header: fun_seq_wb.pls 120.0 2003/09/11 21:30:17 masada noship $ */
3   procedure rosetta_table_copy_in_p1(t out nocopy fun_seq.control_date_tbl_type, a0 JTF_VARCHAR2_TABLE_100
4     , a1 JTF_DATE_TABLE
5     ) as
6     ddindx binary_integer; indx binary_integer;
7   begin
8   if a0 is not null and a0.count=0 then
9     t := fun_seq.control_date_tbl_type();
10   elsif a0 is not null and a0.count > 0 then
11       if a0.count > 0 then
12       t := fun_seq.control_date_tbl_type();
13       t.extend(a0.count);
14         indx := a0.first;
15         ddindx := 1;
16         while true loop
17           t(ddindx).date_type := a0(indx);
18           t(ddindx).date_value := a1(indx);
19           ddindx := ddindx+1;
20           if a0.last =indx
21             then exit;
22           end if;
23           indx := a0.next(indx);
24         end loop;
25       end if;
26    end if;
27   end rosetta_table_copy_in_p1;
28   procedure rosetta_table_copy_out_p1(t fun_seq.control_date_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_100
29     , a1 out nocopy JTF_DATE_TABLE
30     ) as
31     ddindx binary_integer; indx binary_integer;
32   begin
33   if t is null then
34     a0 := null;
35     a1 := null;
36   elsif t.count = 0 then
37     a0 := JTF_VARCHAR2_TABLE_100();
38     a1 := JTF_DATE_TABLE();
39   else
40       a0 := JTF_VARCHAR2_TABLE_100();
41       a1 := JTF_DATE_TABLE();
42       if t.count > 0 then
43         a0.extend(t.count);
44         a1.extend(t.count);
45         ddindx := t.first;
46         indx := 1;
47         while true loop
48           a0(indx) := t(ddindx).date_type;
49           a1(indx) := t(ddindx).date_value;
50           indx := indx+1;
51           if t.last =ddindx
52             then exit;
53           end if;
54           ddindx := t.next(ddindx);
55         end loop;
56       end if;
57    end if;
58   end rosetta_table_copy_out_p1;
59 
60   procedure get_sequence_number(p_context_type  VARCHAR2
61     , p_context_value  VARCHAR2
62     , p_application_id  NUMBER
63     , p_table_name  VARCHAR2
64     , p_event_code  VARCHAR2
65     , p5_a0  VARCHAR2
66     , p5_a1  VARCHAR2
67     , p5_a2  VARCHAR2
68     , p5_a3  VARCHAR2
69     , p5_a4  VARCHAR2
70     , p5_a5  VARCHAR2
71     , p6_a0 JTF_VARCHAR2_TABLE_100
72     , p6_a1 JTF_DATE_TABLE
73     , p_suppress_error  VARCHAR2
74     , x_seq_version_id out nocopy  NUMBER
75     , x_sequence_number out nocopy  NUMBER
76     , x_assignment_id out nocopy  NUMBER
77     , x_error_code out nocopy  VARCHAR2
78   )
79 
80   as
81     ddp_control_attribute_rec fun_seq.control_attribute_rec_type;
82     ddp_control_date_tbl fun_seq.control_date_tbl_type;
83     ddindx binary_integer; indx binary_integer;
84   begin
85 
86     -- copy data to the local IN or IN-OUT args, if any
87 
88 
89 
90 
91 
92     ddp_control_attribute_rec.balance_type := p5_a0;
93     ddp_control_attribute_rec.journal_source := p5_a1;
94     ddp_control_attribute_rec.journal_category := p5_a2;
95     ddp_control_attribute_rec.document_category := p5_a3;
96     ddp_control_attribute_rec.accounting_event_type := p5_a4;
97     ddp_control_attribute_rec.accounting_entry_type := p5_a5;
98 
99     fun_seq_w.rosetta_table_copy_in_p1(ddp_control_date_tbl, p6_a0
100       , p6_a1
101       );
102 
103 
104 
105 
106 
107 
108     -- here's the delegated call to the old PL/SQL routine
109     fun_seq.get_sequence_number(p_context_type,
110       p_context_value,
111       p_application_id,
112       p_table_name,
113       p_event_code,
114       ddp_control_attribute_rec,
115       ddp_control_date_tbl,
116       p_suppress_error,
117       x_seq_version_id,
118       x_sequence_number,
119       x_assignment_id,
120       x_error_code);
121 
122     -- copy data back from the local variables to OUT or IN-OUT args, if any
123 
124 
125 
126 
127 
128 
129 
130 
131 
132 
133 
134   end;
135 
136 end fun_seq_w;