Tuesday 2 May 2017

Register custom table in oracle application R12

Register Table 
procedure register_table
(p_appl_short_name in varchar2, –Custom Application Short Name
p_table_name in varchar2, –Table Name
p_table_type in varchar2, –Table type,Use ’T’ if it is a transaction table & ’S’ for a ”seed data” table
p_next_extent in number default 512,
p_pct_free in number default 10, –Percentage of space in each of the table’s blocks reserved for future updates to the table (1–99)
p_pct_used in number default 70); –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

Register Column 
procedure register_column
(p_appl_short_name in varchar2, –Custom Application Short Name
p_table_name in varchar2, –Table Name
p_column_name in varchar2, –Column Name
p_column_seq in number, –Sequence number of Column in table
p_column_type in varchar2, –Column Type (’NUMBER’, ’VARCHAR2’, ’DATE’, etc.).
p_column_width in number, –Colum Size,Can use 9 for DATE columns, 38 for NUMBER columns
p_nullable in varchar2, –Use ’N’ if the column is mandatory or ’Y’ if the column allows null values
p_translate in varchar2, –’N’ if the values are not translated (most application columns)
p_precision in number default null, –Number of digits in a number
p_scale in number default null); –Number of digits to the right of the decimal point in a number

Example

create table XXTEST_TEST_TABLE
(
unique_id number,
NAme varchar2(100),
Creation_Date date,
created_by number
)

API for register table 
Begin
ad_dd.REGISTER_TABLE('XXTEST','XXTEST_TEST_TABLE','T',1,10,0);
End;

Commit;

API for register column

EXECUTE ad_dd.REGISTER_COLUMN('XXTEST','XXTEST_TEST_TABLE','UNIQUE_ID',1,'NUMBER',38,'Y','N');

EXECUTE ad_dd.REGISTER_COLUMN('XXTEST','XXTEST_TEST_TABLE','NAME',2,'VARCHAR2',20,'Y','N')

EXECUTE ad_dd.REGISTER_COLUMN('XXTEST','XXTEST_TEST_TABLE','CREATION_DATE',3,'DATE',20,'Y','N')

EXECUTE ad_dd.REGISTER_COLUMN('XXTEST','XXTEST_TEST_TABLE','CREATED_BY',4,'NUMBER',38,'Y','N')

Commit;

Register Primary key in oracle application

execute ad_dd.register_primary_key('XXTEST', 'UNIQE_ID_PK', 'XXTEST_TEST_TABLE','UNIQE_ID_PK', 'S', 'Y','Y');

Commit;

Register Primary key column in oracle application

execute ad_dd.register_primary_key_column('XXTEST', 'UNIQE_ID_PK','XXTEST_TEST_TABLE', 'UNIQUE_ID', 1);

Commit;

How to check table registered in oracle application

Goto-->

Application Developer--> application-->Database-->Table

Search Table by Table name and detail will be shown

API for De-register table from oracle apps

EXECUTE ad_dd.DELETE_TABLE('BTVL', 'BTVL_TEST_TABLE');

COMMIT;

DROP TABLE BTVL_TEST_TABLE

1 comment:

AOL SYLLABUS: PREREQUISITE SQL PL/SQL D2K GENERAL INTRODUCTION KNOW HOW OF ERP Version of Oracle Apps 11i Comparison of 10.7/11...