Thursday, September 19, 2013

Registering a custom table in Oracle Apps.


CREATE TABLE emp_details
(
   eno                  NUMBER (6) CONSTRAINT eno_pk PRIMARY KEY,
   ename                VARCHAR2 (15) NOT NULL,
   dept                 VARCHAR2 (15),
   jdate                DATE,
   salary               NUMBER,
   created_by           NUMBER (15),
   creation_date        DATE,
   last_updated_by      NUMBER (15),
   last_update_date     DATE,
   Last_update_login    VARCHAR2 (50),
   attribute1           VARCHAR2 (50),
   attribute2           VARCHAR2 (50),
   attribute3           VARCHAR2 (50),
   attribute4           VARCHAR2 (50),
   attribute5           VARCHAR2 (50),
   attribute_category   VARCHAR2 (100)
);

Grant all on emp_details to Apps;

COMMIT;

EXECUTE AD_DD.Register_Table('SQLGL','emp_details','T',8,10,90); 

EXECUTE AD_DD.Register_Column('SQLGL','emp_details','empno',1,'Number',6,'N','Y'); 
EXECUTE AD_DD.Register_Column('SQLGL','emp_details','ename',2,'Varchar2',15,'N','Y');  
EXECUTE AD_DD.Register_Column('SQLGL','emp_details','dept',3,'Varchar2',15,'Y','Y');  
EXECUTE AD_DD.Register_Column('SQLGL','emp_details','jdate',4,'Date',11,'Y','Y'); 
EXECUTE AD_DD.Register_Column('SQLGL','emp_details','salary',5,'Number',38,'Y','Y');  
EXECUTE AD_DD.Register_Column('SQLGL','emp_details','created_by',6,'Number',15,'Y','Y'); 
EXECUTE AD_DD.Register_Column('SQLGL','emp_details','creation_date',7,'Date',11,'Y','Y'); 
EXECUTE AD_DD.Register_Column('SQLGL','emp_details','last_updated_by',8,'Number',15,'Y','Y');  
EXECUTE AD_DD.Register_Column('SQLGL','emp_details','last_update_date',9,'Date',11,'Y','Y');  
EXECUTE AD_DD.Register_Column('SQLGL','emp_details','attribute1',10,'Varchar2',50,'Y','Y');  
EXECUTE AD_DD.Register_Column('SQLGL','emp_details','attribute2',11,'Varchar2',50,'Y','Y');  
EXECUTE AD_DD.Register_Column('SQLGL','emp_details','attribute3',12,'Varchar2',50,'Y','Y');  
EXECUTE AD_DD.Register_Column('SQLGL','emp_details','attribute4',13,'Varchar2',50,'Y','Y');  
EXECUTE AD_DD.Register_Column('SQLGL','emp_details','attribute5',14,'Varchar2',50,'Y','Y');  
EXECUTE AD_DD.Register_Column('SQLGL','emp_details','attribute_category',15,'Varchar2',100,'Y','Y'); 
 
COMMIT;

SELECT * FROM emp_details;

for checking in front end

go to appication developer >> applications >> database >> TABLE