select column_text,column_name
from  ec_apps_tables a,
     ec_apps_tables_description b,
     ec_company_apps_tables     c
where c.company_code='01'
  and a.apps_table_id=b.apps_table_id
  and a.apps_table_id=c.apps_table_id
  and a.language_id=1
  and a.apps_code='MCH';

insert into ec_apps_tables
 ( 
     apps_table_id, table_name,apps_code,language_id,is_active
 )
 value
 (   1,'MC_RELATIONSHIP','MCH',1,1
 );

Insert into ec_apps_tables_description
 (
    apps_table_desc_id   ,
    apps_table_id        ,
    display_seq          ,
    column_name          ,
    column_text          ,
    column_hint          ,
    data_type            ,
    attribute_type       ,
    data_length          ,
    is_nullable          ,
    is_multi_value       ,
    multi_value_attribute,
    is_active
 )
values
 (1,1,1,'RELATIONSHIP_ID', 'Relationship ID','Enter Relationship id', 'int','int','11',0,0, null,1 );
Insert into ec_apps_tables_description
 (
    apps_table_desc_id   ,
    apps_table_id        ,
    display_seq          ,
    column_name          ,
    column_text          ,
    column_hint          ,
    data_type            ,
    attribute_type       ,
    data_length          ,
    is_nullable          ,
    is_multi_value       ,
    multi_value_attribute,
    is_active
 )
values
 (2,
  1,
  2,
  'RELATIONSHIP_NAME',
  'Relationship  Desc',
  'Enter Relationship Description',
  'varchar2',
  'string',
  '40',
   0,
   0,
   null,
   1
  );

Insert into ec_apps_tables_description
 (
    apps_table_desc_id   ,
    apps_table_id        ,
    display_seq          ,
    column_name          ,
    column_text          ,
    column_hint          ,
    data_type            ,
    attribute_type       ,
    data_length          ,
    is_nullable          ,
    is_multi_value       ,
    multi_value_attribute,
    is_active
 )
values
 (3,1,3,'DISPLAY_SEQ','Display Sequence','Enter Display Order','int','int','11',0,0,null,1);
Insert into ec_apps_tables_description
 (
    apps_table_desc_id   ,
    apps_table_id        ,
    display_seq          ,
    column_name          ,
    column_text          ,
    column_hint          ,
    data_type            ,
    attribute_type       ,
    data_length          ,
    is_nullable          ,
    is_multi_value       ,
    multi_value_attribute,
    is_active
 )
values
 (4,1,4,'IS_ACTIVE','Is Active','Please select the value from list','int','list','1',0,1,'is_active_option_values',1);


insert ec_company_apps_tables
  (
  company_apps_table_id,
  apps_table_id        ,
  company_code         , 
  is_active            
  )
values
  (1,1,'01',1);

insert into ec_apps_tables
 ( 
     apps_table_id  ,
     table_name     ,
     apps_code      ,
     language_id    ,
     is_active      
 )
 value
 (   1,'MC_RELATIONSHIP','MCH',1,1);

insert into ec_apps_tables
 (
     apps_table_id  ,
     table_name     ,
     apps_code      ,
     language_id    ,
     is_active
 )
 value
 (   2,'MC_RELATIONSHIP','MCH',1,1);
 
