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