WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
WHENEVER OSERROR  EXIT FAILURE ROLLBACK;

spool SYS_CODES.log

prompt
prompt Creating table SYS_CODES
prompt ========================
prompt
whenever sqlerror continue
drop table SYS_CODES;
whenever sqlerror exit failure rollback

create table SYS_CODES
(
  CODE_ID             NUMBER not null,
  CODE                VARCHAR2(100) not null,
  SYS_FLAG            VARCHAR2(1) not null,
  ENABLED_FLAG        VARCHAR2(1) not null,
  CODE_NAME_ID        NUMBER,
  CODE_PROMPT_ID      NUMBER,
  CODE_NAME_PROMPT_ID NUMBER,
  CREATION_DATE       DATE not null,
  CREATED_BY          NUMBER not null,
  LAST_UPDATE_DATE    DATE not null,
  LAST_UPDATED_BY     NUMBER not null
);
alter table SYS_CODES
  add constraint SYS_CODES_PK primary key (CODE_ID);

create unique index SYS_CODES_U1 on SYS_CODES (CODE);
 
spool off

exit
