PROMPT Creating table SUPER_AGENTS

create table super_agents ( 
   agent_code                    char(5) not null,
   row_create_time               date,
   row_date_time                 date,
   cuser                         varchar2(30),
   muser                         varchar2(30),
   mterm                         varchar2(64),
   source                        varchar2(8),
   to_be_archived                varchar2(1),
   appn_row_id                   number(18) not null,
   system_id                     number(4) default 0 not null
);

alter table super_agents add ( constraint super_agents_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table super_agents add ( constraint super_agents_uk1 unique (agent_code) using index tablespace &1._indexes);

alter table super_agents add constraint fk_super_agent foreign key(agent_code) references agents(agent_code) on delete cascade;

COMMENT ON TABLE SUPER_AGENTS IS 'This table contains details of agents which have access to all flights ';

COMMENT ON COLUMN SUPER_AGENTS.AGENT_CODE IS  'Agent code';
COMMENT ON COLUMN SUPER_AGENTS.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN SUPER_AGENTS.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN SUPER_AGENTS.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN SUPER_AGENTS.CUSER IS 'The user who created the row';
COMMENT ON COLUMN SUPER_AGENTS.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN SUPER_AGENTS.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN SUPER_AGENTS.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN SUPER_AGENTS.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN SUPER_AGENTS.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
