-- SQL script for generation of loading tables 
--     here: Module MODEL_INPUT            ft, 1999.07.21

create table NEW_MODEL_TYPE    (
       model_type_id           number(15)    PRIMARY KEY,
       model_type_acronym      varchar(31)   NOT NULL,
       model_type_name         varchar(250)  NOT NULL,
       model_type_descr        varchar(2000) NOT NULL
       );

create table NEW_MODEL         (
       model_id                number(15)    PRIMARY KEY,
       model_type_id           number(15)    ,
       model_acronym           varchar(31)   NOT NULL,
       model_name              varchar(250)  NOT NULL,
       model_descr             varchar(2000) NOT NULL
       );

create table LOAD_MODEL        (
       entry_id                number(15)    NOT NULL references LOAD_ENTRY on delete cascade,
       model_acronym           varchar(31)   DEFAULT 'not filled' NOT NULL,
       model_name              varchar(250)  DEFAULT 'not filled' NOT NULL,
       model_type_acronym      varchar(31)   DEFAULT 'not filled' NOT NULL,
       topic_name              varchar(80)   DEFAULT 'not filled' NOT NULL,
       value_number            number        DEFAULT 0            NOT NULL,
       unit_name               varchar(80)   DEFAULT 'not filled' NOT NULL,
       value_string            varchar(2000) DEFAULT 'not filled'         ,
       calculation_start       date          DEFAULT SYSDATE      NOT NULL
       );

