[Home] [Help]
PACKAGE BODY: APPS.HR_LOC_INS
Source
1 PACKAGE BODY hr_loc_ins AS
2 /* $Header: hrlocrhi.pkb 120.7 2006/05/15 13:34:54 srenukun noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package VARCHAR2(33) := ' hr_loc_ins.'; -- Global package name
9 --
10 -- The following global variables are only to be used by
11 -- the set_base_key_value and pre_insert procedures.
12 --
13 g_location_id_i number default null;
14 --
15 -- ----------------------------------------------------------------------------
16 -- |------------------------< set_base_key_value >----------------------------|
17 -- ----------------------------------------------------------------------------
18 procedure set_base_key_value
19 (p_location_id in number) is
20 --
21 l_proc varchar2(72) := g_package||'set_base_key_value';
22 --
23 Begin
24 hr_utility.set_location('Entering:'||l_proc, 10);
25 --
26 hr_loc_ins.g_location_id_i := p_location_id;
27 --
28 hr_utility.set_location(' Leaving:'||l_proc, 20);
29 End set_base_key_value;
30 --
31 -- ----------------------------------------------------------------------------
32 -- |------------------------------< insert_dml >------------------------------|
33 -- ----------------------------------------------------------------------------
34 -- {Start Of Comments}
35 --
36 -- Description:
37 -- This procedure controls the actual dml insert logic. The processing of
38 -- this procedure are as follows:
39 -- 1) Initialise the object_version_number to 1 if the object_version_number
40 -- is defined as an attribute for this entity.
41 -- 2) To set and unset the g_api_dml status as required (as we are about to
42 -- perform dml).
43 -- 3) To insert the row into the schema.
44 -- 4) To trap any constraint violations that may have occurred.
45 -- 5) To raise any other errors.
46 --
47 -- Prerequisites:
48 -- This is an internal private procedure which must be called from the ins
49 -- procedure and must have all mandatory attributes set (except the
50 -- object_version_number which is initialised within this procedure).
51 --
52 -- In Parameters:
53 -- A Pl/Sql record structre.
54 --
55 -- Post Success:
56 -- The specified row will be inserted into the schema.
57 --
58 -- Post Failure:
59 -- On the insert dml failure it is important to note that we always reset the
60 -- g_api_dml status to false.
61 -- If a check, unique or parent integrity constraint violation is raised the
62 -- constraint_error procedure will be called.
63 -- If any other error is reported, the error will be raised after the
64 -- g_api_dml status is reset.
65 --
66 -- Developer Implementation Notes:
67 -- None.
68 --
69 -- Access Status:
70 -- Internal Row Handler Use Only.
71 --
72 -- {End Of Comments}
73 -- ----------------------------------------------------------------------------
74 PROCEDURE insert_dml(p_rec IN OUT NOCOPY hr_loc_shd.g_rec_type) IS
75 --
76 l_proc VARCHAR2(72) := g_package||'insert_dml';
77 --
78 BEGIN
79 hr_utility.set_location('Entering:'||l_proc, 5);
80 p_rec.object_version_number := 1; -- Initialise the object version
81 --
82 hr_loc_shd.g_api_dml := true; -- Set the api dml status
83 --
84 -- Insert the row into: hr_locations_all
85 --
86 INSERT INTO hr_locations_all
87 ( location_id,
88 entered_by,
89 location_code,
90 timezone_code,
91 address_line_1,
92 address_line_2,
93 address_line_3,
94 bill_to_site_flag,
95 country,
96 description,
97 designated_receiver_id,
98 in_organization_flag,
99 inactive_date,
100 inventory_organization_id,
101 office_site_flag,
102 postal_code,
103 receiving_site_flag,
104 region_1,
105 region_2,
106 region_3,
107 ship_to_location_id,
108 ship_to_site_flag,
109 derived_locale,
110 style,
111 -- tax_name,
112 telephone_number_1,
113 telephone_number_2,
114 telephone_number_3,
115 town_or_city,
116 loc_information13,
117 loc_information14,
118 loc_information15,
119 loc_information16,
120 loc_information17,
121 loc_information18,
122 loc_information19,
123 loc_information20,
124 attribute_category,
125 attribute1,
126 attribute2,
127 attribute3,
128 attribute4,
129 attribute5,
130 attribute6,
131 attribute7,
132 attribute8,
133 attribute9,
134 attribute10,
135 attribute11,
136 attribute12,
137 attribute13,
138 attribute14,
139 attribute15,
140 attribute16,
141 attribute17,
142 attribute18,
143 attribute19,
144 attribute20,
145 object_version_number,
146 global_attribute_category,
147 global_attribute1,
148 global_attribute2,
149 global_attribute3,
150 global_attribute4,
151 global_attribute5,
152 global_attribute6,
153 global_attribute7,
154 global_attribute8,
155 global_attribute9,
156 global_attribute10,
157 global_attribute11,
158 global_attribute12,
159 global_attribute13,
160 global_attribute14,
161 global_attribute15,
162 global_attribute16,
163 global_attribute17,
164 global_attribute18,
165 global_attribute19,
166 global_attribute20,
167 legal_address_flag,
168 tp_header_id,
169 ece_tp_location_code,
170 business_group_id,
171 geometry
172 )
173 VALUES
174 ( p_rec.location_id,
175 p_rec.entered_by,
176 p_rec.location_code,
177 p_rec.timezone_code,
178 p_rec.address_line_1,
179 p_rec.address_line_2,
180 p_rec.address_line_3,
181 p_rec.bill_to_site_flag,
182 p_rec.country,
183 p_rec.description,
184 p_rec.designated_receiver_id,
185 p_rec.in_organization_flag,
186 p_rec.inactive_date,
187 p_rec.inventory_organization_id,
188 p_rec.office_site_flag,
189 p_rec.postal_code,
190 p_rec.receiving_site_flag,
191 p_rec.region_1,
192 p_rec.region_2,
193 p_rec.region_3,
194 p_rec.ship_to_location_id,
195 p_rec.ship_to_site_flag,
196 p_rec.derived_locale,
197 p_rec.style,
198 -- p_rec.tax_name,
199 p_rec.telephone_number_1,
200 p_rec.telephone_number_2,
201 p_rec.telephone_number_3,
202 p_rec.town_or_city,
203 p_rec.loc_information13,
204 p_rec.loc_information14,
205 p_rec.loc_information15,
206 p_rec.loc_information16,
207 p_rec.loc_information17,
208 p_rec.loc_information18,
209 p_rec.loc_information19,
210 p_rec.loc_information20,
211 p_rec.attribute_category,
212 p_rec.attribute1,
213 p_rec.attribute2,
214 p_rec.attribute3,
215 p_rec.attribute4,
216 p_rec.attribute5,
217 p_rec.attribute6,
218 p_rec.attribute7,
219 p_rec.attribute8,
220 p_rec.attribute9,
221 p_rec.attribute10,
222 p_rec.attribute11,
223 p_rec.attribute12,
224 p_rec.attribute13,
225 p_rec.attribute14,
226 p_rec.attribute15,
227 p_rec.attribute16,
228 p_rec.attribute17,
229 p_rec.attribute18,
230 p_rec.attribute19,
231 p_rec.attribute20,
232 p_rec.object_version_number,
233 p_rec.global_attribute_category,
234 p_rec.global_attribute1,
235 p_rec.global_attribute2,
236 p_rec.global_attribute3,
237 p_rec.global_attribute4,
238 p_rec.global_attribute5,
239 p_rec.global_attribute6,
240 p_rec.global_attribute7,
241 p_rec.global_attribute8,
242 p_rec.global_attribute9,
243 p_rec.global_attribute10,
244 p_rec.global_attribute11,
245 p_rec.global_attribute12,
246 p_rec.global_attribute13,
247 p_rec.global_attribute14,
248 p_rec.global_attribute15,
249 p_rec.global_attribute16,
250 p_rec.global_attribute17,
251 p_rec.global_attribute18,
252 p_rec.global_attribute19,
253 p_rec.global_attribute20,
254 p_rec.legal_address_flag,
255 p_rec.tp_header_id,
256 p_rec.ece_tp_location_code,
257 p_rec.business_group_id,
258 p_rec.geometry
259 );
260 --
261 hr_loc_shd.g_api_dml := false; -- Unset the api dml status
262 --
263 hr_utility.set_location(' Leaving:'||l_proc, 10);
264 EXCEPTION
265 WHEN hr_api.check_integrity_violated THEN
266 -- A check constraint has been violated
267 hr_loc_shd.g_api_dml := false; -- Unset the api dml status
268 hr_loc_shd.constraint_error
269 (p_constraint_name => hr_api.strip_constraint_name(sqlerrm));
270 WHEN hr_api.parent_integrity_violated THEN
271 -- Parent integrity has been violated
272 hr_loc_shd.g_api_dml := false; -- Unset the api dml status
273 hr_loc_shd.constraint_error
274 (p_constraint_name => hr_api.strip_constraint_name(sqlerrm));
275 WHEN hr_api.unique_integrity_violated THEN
276 -- Unique integrity has been violated
277 hr_loc_shd.g_api_dml := false; -- Unset the api dml status
278 hr_loc_shd.constraint_error
279 (p_constraint_name => hr_api.strip_constraint_name(sqlerrm));
280 WHEN OTHERS THEN
281 hr_loc_shd.g_api_dml := false; -- Unset the api dml status
282 RAISE;
283 END insert_dml;
284 --
285 -- ----------------------------------------------------------------------------
286 -- |------------------------------< pre_insert >------------------------------|
287 -- ----------------------------------------------------------------------------
288 -- {Start Of Comments}
289 --
290 -- Description:
291 -- This private procedure contains any processing which is required before
292 -- the insert dml. Presently, if the entity has a corresponding primary
293 -- key which is maintained by an associating sequence, the primary key for
294 -- the entity will be populated with the next sequence value in
295 -- preparation for the insert dml.
296 --
297 -- Prerequisites:
298 -- This is an internal procedure which is called from the ins procedure.
299 --
300 -- In Parameters:
301 -- A Pl/Sql record structre and effective date.
302 --
303 -- Post Success:
304 -- Processing continues.
305 --
306 -- Post Failure:
307 -- If an error has occurred, an error message and exception will be raised
308 -- but not handled.
309 --
310 -- Developer Implementation Notes:
311 -- Any pre-processing required before the insert dml is issued should be
312 -- coded within this procedure. As stated above, a good example is the
313 -- generation of a primary key number via a corresponding sequence.
314 -- It is important to note that any 3rd party maintenance should be reviewed
315 -- before placing in this procedure.
316 --
317 -- Access Status:
318 -- Internal Row Handler Use Only.
319 --
320 -- {End Of Comments}
321 -- ----------------------------------------------------------------------------
322 PROCEDURE pre_insert(p_rec IN OUT NOCOPY hr_loc_shd.g_rec_type) IS
323 --
324 l_proc VARCHAR2(72) := g_package||'pre_insert';
325 --
326 cursor csr_next_location_id IS
327 SELECT hr_locations_s.nextval
328 FROM sys.dual;
329 --
330 l_number_table dbms_describe.number_table;
331 l_varchar_table dbms_describe.varchar2_table;
332 l_package_exists boolean;
333 l_package_name varchar2(2000);
334 --
335 BEGIN
336 hr_utility.set_location('Entering:'||l_proc, 5);
337 --
338 --
339 -- Select the next sequence number for hr_locations_all.location_id:
340 --
341 OPEN csr_next_location_id;
342 FETCH csr_next_location_id INTO p_rec.location_id;
343 CLOSE csr_next_location_id;
344
345 IF p_rec.ship_to_location_id IS NULL THEN
346 p_rec.ship_to_location_id := p_rec.location_id;
347 END IF;
348
349
350 --
351 -- do not call Irc_location_utility.address2geometry function if all parameters passed are null
352 --
353 if((p_rec.address_line_1 is null)
354 and (p_rec.address_line_2 is null)
355 and (p_rec.address_line_3 is null)
356 and (p_rec.town_or_city is null)
357 and (p_rec.region_1 is null)
358 and (p_rec.region_2 is null)
359 and ( p_rec.region_3 is null)
360 and (p_rec.postal_code is null)
361 and (p_rec.country is null)) then
362
363 hr_utility.set_location('Not calling address2geometry:'||l_proc, 8);
364
365 else
366 --
367 --
368 --
369 -- Enhancement added for Location Searching
370 --
371 if ((fnd_profile.value('IRC_INSTALLED_FLAG') in ('Y','D')) and
372 (fnd_profile.value('IRC_GEOCODE_HOST')is not null)
373 )then
374 p_rec.geometry := Irc_location_utility.address2geometry
375 (address_line1 => p_rec.address_line_1
376 ,address_line2 => p_rec.address_line_2
377 ,address_line3 => p_rec.address_line_3
378 ,address_line4 => p_rec.town_or_city
379 ,address_line5 => p_rec.region_1
380 ,address_line6 => p_rec.region_2
381 ,address_line7 => p_rec.region_3
382 ,address_line8 => p_rec.postal_code
383 ,country => p_rec.country
384 );
385 end if;
386 --
387 end if;
388
389 hr_loc_shd.derive_locale(p_rec);
390 --
391 hr_utility.set_location(' Leaving:'||l_proc, 10);
392 END pre_insert;
393 --
394 -- ----------------------------------------------------------------------------
395 -- |-----------------------------< post_insert >------------------------------|
396 -- ----------------------------------------------------------------------------
397 -- {Start Of Comments}
398 --
399 -- Description:
400 -- This private procedure contains any processing which is required after the
401 -- insert dml.
402 --
403 -- Prerequisites:
404 -- This is an internal procedure which is called from the ins procedure.
405 --
406 -- In Parameters:
407 -- A Pl/Sql record structre.
408 --
409 -- Post Success:
410 -- Processing continues.
411 --
412 -- Post Failure:
413 -- If an error has occurred, an error message and exception will be raised
414 -- but not handled.
415 --
416 -- Developer Implementation Notes:
417 -- Any post-processing required after the insert dml is issued should be
418 -- coded within this procedure. It is important to note that any 3rd party
419 -- maintenance should be reviewed before placing in this procedure.
420 --
421 -- Access Status:
422 -- Internal Row Handler Use Only.
423 --
424 -- {End Of Comments}
425 -- ----------------------------------------------------------------------------
426 PROCEDURE post_insert(p_rec IN hr_loc_shd.g_rec_type,
427 p_effective_date IN DATE) IS
428 --
429 l_proc VARCHAR2(72) := g_package||'post_insert';
430 --
431 BEGIN
432 hr_utility.set_location('Entering:'||l_proc, 5);
433 --
434 -- Start of API User Hook for the before hook of create_location
435 --
436 hr_loc_rki.after_insert
437 (p_effective_date => p_effective_date
438 ,p_location_id => p_rec.location_id
439 ,p_location_code => p_rec.location_code
440 ,p_timezone_code => p_rec.timezone_code
441 ,p_address_line_1 => p_rec.address_line_1
442 ,p_address_line_2 => p_rec.address_line_2
443 ,p_address_line_3 => p_rec.address_line_3
444 ,p_bill_to_site_flag => p_rec.bill_to_site_flag
445 ,p_country => p_rec.country
446 ,p_description => p_rec.description
447 ,p_designated_receiver_id => p_rec.designated_receiver_id
448 ,p_in_organization_flag => p_rec.in_organization_flag
449 ,p_inactive_date => p_rec.inactive_date
450 ,p_inventory_organization_id => p_rec.inventory_organization_id
451 ,p_office_site_flag => p_rec.office_site_flag
452 ,p_postal_code => p_rec.postal_code
453 ,p_receiving_site_flag => p_rec.receiving_site_flag
454 ,p_region_1 => p_rec.region_1
455 ,p_region_2 => p_rec.region_2
456 ,p_region_3 => p_rec.region_3
457 ,p_ship_to_location_id => p_rec.ship_to_location_id
458 ,p_ship_to_site_flag => p_rec.ship_to_site_flag
459 ,p_style => p_rec.style
460 ,p_tax_name => p_rec.tax_name
461 ,p_telephone_number_1 => p_rec.telephone_number_1
462 ,p_telephone_number_2 => p_rec.telephone_number_2
463 ,p_telephone_number_3 => p_rec.telephone_number_3
464 ,p_town_or_city => p_rec.town_or_city
465 ,p_loc_information13 => p_rec.loc_information13
466 ,p_loc_information14 => p_rec.loc_information14
467 ,p_loc_information15 => p_rec.loc_information15
468 ,p_loc_information16 => p_rec.loc_information16
469 ,p_loc_information17 => p_rec.loc_information17
470 ,p_loc_information18 => p_rec.loc_information18
471 ,p_loc_information19 => p_rec.loc_information19
472 ,p_loc_information20 => p_rec.loc_information20
473 ,p_attribute_category => p_rec.attribute_category
474 ,p_attribute1 => p_rec.attribute1
475 ,p_attribute2 => p_rec.attribute2
476 ,p_attribute3 => p_rec.attribute3
477 ,p_attribute4 => p_rec.attribute4
478 ,p_attribute5 => p_rec.attribute5
479 ,p_attribute6 => p_rec.attribute6
480 ,p_attribute7 => p_rec.attribute7
481 ,p_attribute8 => p_rec.attribute8
482 ,p_attribute9 => p_rec.attribute9
483 ,p_attribute10 => p_rec.attribute10
484 ,p_attribute11 => p_rec.attribute11
485 ,p_attribute12 => p_rec.attribute12
486 ,p_attribute13 => p_rec.attribute13
487 ,p_attribute14 => p_rec.attribute14
488 ,p_attribute15 => p_rec.attribute15
489 ,p_attribute16 => p_rec.attribute16
490 ,p_attribute17 => p_rec.attribute17
491 ,p_attribute18 => p_rec.attribute18
492 ,p_attribute19 => p_rec.attribute19
493 ,p_attribute20 => p_rec.attribute20
494 ,p_global_attribute_category => p_rec.global_attribute_category
495 ,p_global_attribute1 => p_rec.global_attribute1
496 ,p_global_attribute2 => p_rec.global_attribute2
497 ,p_global_attribute3 => p_rec.global_attribute3
498 ,p_global_attribute4 => p_rec.global_attribute4
499 ,p_global_attribute5 => p_rec.global_attribute5
500 ,p_global_attribute6 => p_rec.global_attribute6
501 ,p_global_attribute7 => p_rec.global_attribute7
502 ,p_global_attribute8 => p_rec.global_attribute8
503 ,p_global_attribute9 => p_rec.global_attribute9
504 ,p_global_attribute10 => p_rec.global_attribute10
505 ,p_global_attribute11 => p_rec.global_attribute11
506 ,p_global_attribute12 => p_rec.global_attribute12
507 ,p_global_attribute13 => p_rec.global_attribute13
508 ,p_global_attribute14 => p_rec.global_attribute14
509 ,p_global_attribute15 => p_rec.global_attribute15
510 ,p_global_attribute16 => p_rec.global_attribute16
511 ,p_global_attribute17 => p_rec.global_attribute17
512 ,p_global_attribute18 => p_rec.global_attribute18
513 ,p_global_attribute19 => p_rec.global_attribute19
514 ,p_global_attribute20 => p_rec.global_attribute20
515 ,p_legal_address_flag => p_rec.legal_address_flag
516 ,p_tp_header_id => p_rec.tp_header_id
517 ,p_ece_tp_location_code => p_rec.ece_tp_location_code
518 ,p_object_version_number => p_rec.object_version_number
519 ,p_business_group_id => p_rec.business_group_id
520 );
521 EXCEPTION
522 WHEN hr_api.cannot_find_prog_unit THEN
523 hr_api.cannot_find_prog_unit_error
524 (p_module_name => 'HR_LOCATIONS_ALL'
525 ,p_hook_type => 'AI'
526 );
527 --
528 -- End of API User Hook for the before hook of create_location
529 --
530 --
531 hr_utility.set_location(' Leaving:'||l_proc, 10);
532 END post_insert;
533 --
534 -- ----------------------------------------------------------------------------
535 -- |---------------------------------< ins >----------------------------------|
536 -- ----------------------------------------------------------------------------
537 PROCEDURE ins
538 (
539 p_rec IN OUT NOCOPY hr_loc_shd.g_rec_type
540 ,p_effective_date IN DATE
541 ,p_operating_unit_id IN NUMBER
542 ) IS
543 --
544 l_proc VARCHAR2(72) := g_package||'ins';
545 --
546 BEGIN
547 hr_utility.set_location('Entering:'||l_proc, 5);
548 --
549 -- Call the supporting insert validate operations
550 --
551 hr_loc_bus.insert_validate(p_rec
552 ,p_effective_date
553 ,p_operating_unit_id);
554 --
555 --
556 -- Call the supporting pre-insert operation
557 --
558 pre_insert(p_rec);
559 --
560 -- Insert the row
561 --
562 insert_dml(p_rec);
563 --
564 -- Call the supporting post-insert operation
565 --
566 post_insert(p_rec,
567 p_effective_date);
568 --
569 END ins;
570 --
571 -- ----------------------------------------------------------------------------
572 -- |---------------------------------< ins >----------------------------------|
573 -- ----------------------------------------------------------------------------
574 PROCEDURE ins
575 (
576 p_effective_date IN DATE,
577 p_location_id OUT NOCOPY NUMBER,
578 p_object_version_number OUT NOCOPY NUMBER,
579 p_location_code IN VARCHAR2,
580 p_timezone_code IN VARCHAR2 DEFAULT NULL,
581 p_address_line_1 IN VARCHAR2 DEFAULT NULL,
582 p_address_line_2 IN VARCHAR2 DEFAULT NULL,
583 p_address_line_3 IN VARCHAR2 DEFAULT NULL,
584 p_bill_to_site_flag IN VARCHAR2 DEFAULT 'Y',
585 p_country IN VARCHAR2 DEFAULT NULL,
586 p_description IN VARCHAR2 DEFAULT NULL,
587 p_designated_receiver_id IN NUMBER DEFAULT NULL,
588 p_in_organization_flag IN VARCHAR2 DEFAULT 'Y',
589 p_inactive_date IN DATE DEFAULT NULL,
590 p_operating_unit_id IN NUMBER DEFAULT NULL,
591 p_inventory_organization_id IN NUMBER DEFAULT NULL,
592 p_office_site_flag IN VARCHAR2 DEFAULT 'Y',
593 p_postal_code IN VARCHAR2 DEFAULT NULL,
594 p_receiving_site_flag IN VARCHAR2 DEFAULT 'Y',
595 p_region_1 IN VARCHAR2 DEFAULT NULL,
596 p_region_2 IN VARCHAR2 DEFAULT NULL,
597 p_region_3 IN VARCHAR2 DEFAULT NULL,
598 p_ship_to_location_id IN NUMBER DEFAULT NULL,
599 p_ship_to_site_flag IN VARCHAR2 DEFAULT 'Y',
600 p_style IN VARCHAR2 DEFAULT NULL,
601 p_tax_name IN VARCHAR2 DEFAULT NULL,
602 p_telephone_number_1 IN VARCHAR2 DEFAULT NULL,
603 p_telephone_number_2 IN VARCHAR2 DEFAULT NULL,
604 p_telephone_number_3 IN VARCHAR2 DEFAULT NULL,
605 p_town_or_city IN VARCHAR2 DEFAULT NULL,
606 p_loc_information13 IN VARCHAR2 DEFAULT NULL,
607 p_loc_information14 IN VARCHAR2 DEFAULT NULL,
608 p_loc_information15 IN VARCHAR2 DEFAULT NULL,
609 p_loc_information16 IN VARCHAR2 DEFAULT NULL,
610 p_loc_information17 IN VARCHAR2 DEFAULT NULL,
611 p_loc_information18 IN VARCHAR2 DEFAULT NULL,
612 p_loc_information19 IN VARCHAR2 DEFAULT NULL,
613 p_loc_information20 IN VARCHAR2 DEFAULT NULL,
614 p_attribute_category IN VARCHAR2 DEFAULT NULL,
615 p_attribute1 IN VARCHAR2 DEFAULT NULL,
616 p_attribute2 IN VARCHAR2 DEFAULT NULL,
617 p_attribute3 IN VARCHAR2 DEFAULT NULL,
618 p_attribute4 IN VARCHAR2 DEFAULT NULL,
619 p_attribute5 IN VARCHAR2 DEFAULT NULL,
620 p_attribute6 IN VARCHAR2 DEFAULT NULL,
621 p_attribute7 IN VARCHAR2 DEFAULT NULL,
622 p_attribute8 IN VARCHAR2 DEFAULT NULL,
623 p_attribute9 IN VARCHAR2 DEFAULT NULL,
624 p_attribute10 IN VARCHAR2 DEFAULT NULL,
625 p_attribute11 IN VARCHAR2 DEFAULT NULL,
626 p_attribute12 IN VARCHAR2 DEFAULT NULL,
627 p_attribute13 IN VARCHAR2 DEFAULT NULL,
628 p_attribute14 IN VARCHAR2 DEFAULT NULL,
629 p_attribute15 IN VARCHAR2 DEFAULT NULL,
630 p_attribute16 IN VARCHAR2 DEFAULT NULL,
631 p_attribute17 IN VARCHAR2 DEFAULT NULL,
632 p_attribute18 IN VARCHAR2 DEFAULT NULL,
633 p_attribute19 IN VARCHAR2 DEFAULT NULL,
634 p_attribute20 IN VARCHAR2 DEFAULT NULL,
635 p_global_attribute_category IN VARCHAR2 DEFAULT NULL,
636 p_global_attribute1 IN VARCHAR2 DEFAULT NULL,
637 p_global_attribute2 IN VARCHAR2 DEFAULT NULL,
638 p_global_attribute3 IN VARCHAR2 DEFAULT NULL,
639 p_global_attribute4 IN VARCHAR2 DEFAULT NULL,
640 p_global_attribute5 IN VARCHAR2 DEFAULT NULL,
641 p_global_attribute6 IN VARCHAR2 DEFAULT NULL,
642 p_global_attribute7 IN VARCHAR2 DEFAULT NULL,
643 p_global_attribute8 IN VARCHAR2 DEFAULT NULL,
644 p_global_attribute9 IN VARCHAR2 DEFAULT NULL,
645 p_global_attribute10 IN VARCHAR2 DEFAULT NULL,
646 p_global_attribute11 IN VARCHAR2 DEFAULT NULL,
647 p_global_attribute12 IN VARCHAR2 DEFAULT NULL,
648 p_global_attribute13 IN VARCHAR2 DEFAULT NULL,
649 p_global_attribute14 IN VARCHAR2 DEFAULT NULL,
650 p_global_attribute15 IN VARCHAR2 DEFAULT NULL,
651 p_global_attribute16 IN VARCHAR2 DEFAULT NULL,
652 p_global_attribute17 IN VARCHAR2 DEFAULT NULL,
653 p_global_attribute18 IN VARCHAR2 DEFAULT NULL,
654 p_global_attribute19 IN VARCHAR2 DEFAULT NULL,
655 p_global_attribute20 IN VARCHAR2 DEFAULT NULL,
656 p_legal_address_flag IN VARCHAR2 DEFAULT 'N',
657 p_tp_header_id IN NUMBER DEFAULT NULL,
658 p_ece_tp_location_code IN VARCHAR2 DEFAULT NULL,
659 p_business_group_id IN NUMBER DEFAULT NULL
660 ) IS
661 --
662 l_rec hr_loc_shd.g_rec_type;
663 l_proc VARCHAR2(72) := g_package||'ins';
664 --
665 BEGIN
666 hr_utility.set_location('Entering:'||l_proc, 5);
667 --
668 -- Call conversion function to turn arguments into the
669 -- p_rec structure.
670 --
671 l_rec :=
672 hr_loc_shd.convert_args
673 (
674 NULL,
675 p_location_code,
676 p_timezone_code,
677 p_address_line_1,
678 p_address_line_2,
679 p_address_line_3,
680 p_bill_to_site_flag,
681 p_country,
682 p_description,
683 p_designated_receiver_id,
684 p_in_organization_flag,
685 p_inactive_date,
686 p_inventory_organization_id,
687 p_office_site_flag,
688 p_postal_code,
689 p_receiving_site_flag,
690 p_region_1,
691 p_region_2,
692 p_region_3,
693 p_ship_to_location_id,
694 p_ship_to_site_flag,
695 p_style,
696 p_tax_name,
697 p_telephone_number_1,
698 p_telephone_number_2,
699 p_telephone_number_3,
700 p_town_or_city,
701 p_loc_information13,
702 p_loc_information14,
703 p_loc_information15,
704 p_loc_information16,
705 p_loc_information17,
706 p_loc_information18,
707 p_loc_information19,
708 p_loc_information20,
709 p_attribute_category,
710 p_attribute1,
711 p_attribute2,
712 p_attribute3,
713 p_attribute4,
714 p_attribute5,
715 p_attribute6,
716 p_attribute7,
717 p_attribute8,
718 p_attribute9,
719 p_attribute10,
720 p_attribute11,
721 p_attribute12,
722 p_attribute13,
723 p_attribute14,
724 p_attribute15,
725 p_attribute16,
726 p_attribute17,
727 p_attribute18,
728 p_attribute19,
729 p_attribute20,
730 p_global_attribute_category,
731 p_global_attribute1,
732 p_global_attribute2,
733 p_global_attribute3,
734 p_global_attribute4,
735 p_global_attribute5,
736 p_global_attribute6,
737 p_global_attribute7,
738 p_global_attribute8,
739 p_global_attribute9,
740 p_global_attribute10,
741 p_global_attribute11,
742 p_global_attribute12,
743 p_global_attribute13,
744 p_global_attribute14,
745 p_global_attribute15,
746 p_global_attribute16,
747 p_global_attribute17,
748 p_global_attribute18,
749 p_global_attribute19,
750 p_global_attribute20,
751 p_legal_address_flag,
752 p_tp_header_id,
753 p_ece_tp_location_code,
754 NULL,
755 p_business_group_id
756 );
757 --
758 -- Having converted the arguments into the hr_loc_rec
759 -- plsql record structure we call the corresponding record business process.
760 --
761 ins(l_rec
762 ,p_effective_date
763 ,p_operating_unit_id);
764 --
765 -- As the primary key argument(s)
766 -- are specified as an OUT's we must set these values.
767 --
768 p_location_id := l_rec.location_id;
769 p_object_version_number := l_rec.object_version_number;
770 --
771 hr_utility.set_location(' Leaving:'||l_proc, 10);
772 END ins;
773 --
774 END hr_loc_ins;