Sie sind auf Seite 1von 5

http://oracleoverview.

com/register-a-custom-
table-in-apps-ad_dd_package-46
Register a custom table in Apps Schema
If you want to register custom application table , you have to use a PL/SQL routine in
the AD_DD package. You can also use the AD_DD Package to delete the registrations
of tables and columns. frst you have to delete registration column , then you can delete
registration table . For altering the table , frst delete the table and then re-register the
table or column.
?
1
2
3
4
5
6
create table XX_USER_TABLE
(
user_id NUMBER PRIMARY KEY,
user_nae !AR"#AR$(%&',
descri(ti)n !AR"#AR$(*&&'
'+
Below is an illustration on how to register a custom table.
Procedures in the AD_DD Package:
1) REGISTER_TABLE: Procedure for register a custom table in Apps Schema
?
ad_dd.register_table
1
2
3
4
5
6
7
ad_dd,re-ister_table ((_a((l_s.)rt_nae in /arc.ar$,
(_tab_nae in /arc.ar$,
(_tab_t0(e in /arc.ar$,
(_ne1t_e1tent in nuber de2ault 3*$,
(_(ct_2ree in nuber de2ault *&,
(_(ct_used in nuber de2ault 4&
'+
p_appl_short_ name: The application short name of the application that owns
the table (usually your custom application).
p_tab_name: The name of the table (in uppercase letters).
p_tab_type: Use T if it is a transaction table (almost all application tables), or
S for a seed data table.
p_next_extent: The next extent size, in kilobytes. Do not include the K.
p_pct_free: The percentage of space in each of the tables blocks reserved for
future updates to the table (1-99).
p_pct_used: Minimum percentage of used space in each data block of the table
(1-99). The sum of p_pct_free and p_pct_used must be less than 100.
2) REGISTER_COLUMN : Procedure for register a tables Column in Apps Schema
?
1
2
3
4
5
6
7
8
9
10
11
ad_dd,re-ister_c)lun (
(_a((l_s.)rt_nae in /arc.ar$,
(_tab_nae in /arc.ar$,
(_c)l_nae in /arc.ar$,
(_c)l_se5 in nuber,
(_c)l_t0(e in /arc.ar$,
(_c)l_6idt. in nuber,
(_nullable in /arc.ar$,
(_translate in /arc.ar$,
(_(recisi)n in nuber de2ault null,
(_scale in nuber de2ault null'+
p_col_name : The name of the column (in uppercase letters).
p_col_seq : The sequence number of the column in the table (the order in which
the column appears in the table defnition).
p_col_type : The column type (NUMBER, VARCHAR2, DATE, etc.).
p_col_width : The column size (a number). Use 9 for DATE columns, 38 for
NUMBER columns (unless it has a specifc width).
p_nullable : Use N if the column is mandatory or Y if the column allows null
values.
p_translate : Use Y if the column values will be translated for an Oracle E-
Business Suite product release (used only by Oracle E-Business Suite products)
or N if the values are not translated (most application columns).
p_precision : The total number of digits in a number.
p_scale : The number of digits to the right of the decimal point in a number.
3) DELETE_COLUMN : Procedure for deleting a register a tables Column from Apps
Schema
?
1
2
3
4
ad_dd,delete_c)lun (
(_a((l_s.)rt_nae in /arc.ar$,
(_tab_nae in /arc.ar$,
(_c)l_nae in /arc.ar$'+
3) DELETE_TABLE : Procedure for deleting a register a table from Apps Schema
?
ad_dd.delete_table
1
2
3
ad_dd,delete_table (
(_a((l_s.)rt_nae in /arc.ar$,
(_tab_nae in /arc.ar$'+
Something you have to know
The AD_DD API does NOT check for the existence of the registered table or
column in the database schema, but only updates the required AOL tables. You
must ensure that the tables and columns registered actually exist and have the
same format as that defned using the AD_DD API.
You need NOT register views.
You should run the AD_DD procedures against the APPS schema. You must
commit your changes for them to take efect.
Execute the Table Registration API.
7E"LARE
/_a((l_s.)rt_nae !AR"#AR$ (%&' 89 :XX"UST;M:+
/_tab_nae !AR"#AR$ (<$' 89 :XX_USER_TABLE:+ == ".an-e t.e table
nae i2 0)u re5uire
/_tab_t0(e !AR"#AR$ (3&' 89 :T:+
/_ne1t_e1tent NUMBER 89 3*$+
/_(ct_2ree NUMBER+
/_(ct_used NUMBER+
BE>IN
== Unre-ister t.e cust) table i2 it e1ists
ad_dd,delete_table ((_a((l_s.)rt_nae 9? :XX_USER_TABLE:, (_tab_nae 9?
/_tab_nae'+

== Re-ister t.e cust) table
@;R tab_details IN (SELE"T table_nae, tables(ace_nae, (ct_2ree, (ct_used,
ini_trans, a1_trans, initial_e1tent, ne1t_e1tent
@R;M dba_tables
A#ERE table_nae 9 /_tab_nae'
L;;P
ad_dd,re-ister_table ((_a((l_s.)rt_nae 9?
/_a((l_s.)rt_nae,
(_tab_nae 9?
tab_details,table_nae,
(_tab_t0(e 9? /_tab_t0(e,
(_ne1t_e1tent 9? N!L
(tab_details,ne1t_e1tent, 3*$',
(_(ct_2ree 9? N!L
(tab_details,(ct_2ree, *&',
(_(ct_used 9? N!L
(tab_details,(ct_used, 4&'
'+
EN7 L;;P+

== Re-ister t.e c)luns )2 cust) table
@;R all_tab_c)ls IN (SELE"T c)lun_nae, c)lun_id, data_t0(e, data_len-t.,
nullable
@R;M all_tab_c)luns
A#ERE table_nae 9 /_tab_nae'
L;;P
ad_dd,re-ister_c)lun ((_a((l_s.)rt_nae 9?
/_a((l_s.)rt_nae,
(_tab_nae 9? /_tab_nae,
(_c)l_nae 9?
all_tab_c)ls,c)lun_nae,
(_c)l_se5 9?
all_tab_c)ls,c)lun_id,
(_c)l_t0(e 9?
all_tab_c)ls,data_t0(e,
(_c)l_6idt. 9?
all_tab_c)ls,data_len-t.,
(_nullable 9?
all_tab_c)ls,nullable,
(_translate 9? :N:,
(_(recisi)n 9? NULL,
(_scale 9? NULL
'+
EN7 L;;P+

@;R all_Be0s IN (SELE"T c)nstraint_nae, table_nae, c)nstraint_t0(e
@R;M all_c)nstraints
A#ERE c)nstraint_t0(e 9 :P: AN7 table_nae 9 /_tab_nae'
L;;P
ad_dd,re-ister_(riar0_Be0 ((_a((l_s.)rt_nae 9?
/_a((l_s.)rt_nae,
(_Be0_nae 9?
all_Be0s,c)nstraint_nae,
(_tab_nae 9?
all_Be0s,table_nae,
(_descri(ti)n 9? :Re-ister
(riar0 Be0:,
(_Be0_t0(e 9? :S:,
(_audit_2la- 9? :N:,
(_enabled_2la- 9? :Y:
'+

@;R all_c)luns IN (SELE"T c)lun_nae, P;SITI;N
@R;M dba_c)ns_c)luns
A#ERE table_nae 9 all_Be0s,table_nae AN7
c)nstraint_nae 9 all_Be0s,c)nstraint_nae'
L;;P
ad_dd,re-ister_(riar0_Be0_c)lun ((_a((l_s.)rt_nae 9?
/_a((l_s.)rt_nae,
(_Be0_nae 9?
all_Be0s,c)nstraint_nae,
(_tab_nae 9?
all_Be0s,table_nae,
(_c)l_nae 9?
all_c)luns,c)lun_nae,
(_c)l_se5uence 9?
all_c)luns,P;SITI;N
'+
EN7 L;;P+
EN7 L;;P+

";MMIT+
EN7+

Das könnte Ihnen auch gefallen