Register Table and its column:
create or replace procedure XXIMR_REGISTER_TABLE(APPL_SHORT_NAME varchar2,
TABLE_OWNER VARCHAR2,
TABLE_NAME VARCHAR2) is
cursor tbl_column(p_owner varchar2, p_Table varchar2) is
select clmn.COLUMN_NAME,
clmn.DATA_TYPE,
clmn.DATA_LENGTH,
clmn.DATA_PRECISION,
clmn.DATA_SCALE,
clmn.NULLABLE,
clmn.COLUMN_ID
from ALL_TAB_COLUMNS clmn
where clmn.OWNER = p_owner
and clmn.TABLE_NAME = p_Table;
begin
ad_dd.register_table(p_appl_short_name => APPL_SHORT_NAME, p_tab_name => TABLE_NAME, p_tab_type => 'T');
Commit;
for i in tbl_column(TABLE_OWNER, TABLE_NAME) loop
ad_dd.register_column(p_appl_short_name => APPL_SHORT_NAME,
p_tab_name => TABLE_NAME,
p_col_name => i.column_name,
p_col_seq => i.column_id,
p_col_type => i.data_type,
p_col_width => i.data_length,
p_nullable => i.nullable,
p_translate => 'N',
p_precision => i.data_precision,
p_scale => i.data_scale);
end loop;
commit;
end;
create or replace procedure XXIMR_REGISTER_TABLE(APPL_SHORT_NAME varchar2,
TABLE_OWNER VARCHAR2,
TABLE_NAME VARCHAR2) is
cursor tbl_column(p_owner varchar2, p_Table varchar2) is
select clmn.COLUMN_NAME,
clmn.DATA_TYPE,
clmn.DATA_LENGTH,
clmn.DATA_PRECISION,
clmn.DATA_SCALE,
clmn.NULLABLE,
clmn.COLUMN_ID
from ALL_TAB_COLUMNS clmn
where clmn.OWNER = p_owner
and clmn.TABLE_NAME = p_Table;
begin
ad_dd.register_table(p_appl_short_name => APPL_SHORT_NAME, p_tab_name => TABLE_NAME, p_tab_type => 'T');
Commit;
for i in tbl_column(TABLE_OWNER, TABLE_NAME) loop
ad_dd.register_column(p_appl_short_name => APPL_SHORT_NAME,
p_tab_name => TABLE_NAME,
p_col_name => i.column_name,
p_col_seq => i.column_id,
p_col_type => i.data_type,
p_col_width => i.data_length,
p_nullable => i.nullable,
p_translate => 'N',
p_precision => i.data_precision,
p_scale => i.data_scale);
end loop;
commit;
end;
No comments:
Post a Comment