create table QUERY_CONFIG_BRELATION
(
  ID  VARCHAR2(8) not null,
  FID VARCHAR2(8),
  BID VARCHAR2(8)
)
;
alter table QUERY_CONFIG_BRELATION
  add constraint PK_QUERY_CONFIG_BRELATION primary key (ID);



create table QUERY_CONFIG_BUTTON
(
  ID       VARCHAR2(8) not null,
  NAME     VARCHAR2(50),
  ICO      VARCHAR2(50),
  PATHORJS VARCHAR2(300),
  RUNNAME  VARCHAR2(50),
  ROLEIDS  VARCHAR2(100),
  FID      VARCHAR2(8),
  BCODE    VARCHAR2(4)
)
;
alter table QUERY_CONFIG_BUTTON
  add constraint PK_QUERY_CONFIG_BUTTON primary key (ID);


create table QUERY_CONFIG_CONNECTION
(
  ID       VARCHAR2(8) not null,
  FID      VARCHAR2(8),
  MFIELD   VARCHAR2(50),
  CFIELD   VARCHAR2(50),
  JOINTYPE VARCHAR2(1)
)
;
alter table QUERY_CONFIG_CONNECTION
  add constraint PK_QUERY_CONFIG_CONNECTION primary key (ID);



create table QUERY_CONFIG_INIT
(
  ID         VARCHAR2(8) not null,
  FID        VARCHAR2(8),
  QLEFT       VARCHAR2(8),
  FIELD      VARCHAR2(50),
  SYMBOL     VARCHAR2(20),
  WHEREVALUE VARCHAR2(500),
  QRIGHT      VARCHAR2(8),
  LOGIC      CHAR(1)
)
;
alter table QUERY_CONFIG_INIT
  add constraint PK_QUERY_CONFIG_INIT primary key (ID);


create table QUERY_CONFIG_ORDER
(
  ID    VARCHAR2(8) not null,
  FID   VARCHAR2(8),
  FIELD VARCHAR2(50),
  TYPE  CHAR(1)
)
;
alter table QUERY_CONFIG_ORDER
  add constraint QUERY_CONFIG__PK11178936941062 primary key (ID);


create table QUERY_CONFIG_PARAMETER
(
  ID    VARCHAR2(8) not null,
  FID   VARCHAR2(8),
  BID   VARCHAR2(8),
  NAME  VARCHAR2(50),
  FIELD VARCHAR2(50)
)
;
alter table QUERY_CONFIG_PARAMETER
  add constraint PK_QUERY_CONFIG_PARAMETER primary key (ID);



create table QUERY_CONFIG_QUERYFIELD
(
  ID          VARCHAR2(8) not null,
  FID         VARCHAR2(8),
  FIELD       VARCHAR2(50),
  ISPRECISION VARCHAR2(1),
  ISMUST      VARCHAR2(1),
  ISDAY       VARCHAR2(3),
  DVALUE      VARCHAR2(50)
)
;
alter table QUERY_CONFIG_QUERYFIELD
  add constraint PK_QUERY_CONFIG_QUERYFIELD primary key (ID);



create table QUERY_CONFIG_SHOWFIELD
(
  ID       VARCHAR2(8) not null,
  FID      VARCHAR2(8),
  FIELD    VARCHAR2(50),
  ISSHOW   CHAR(1),
  COLWIDTH VARCHAR2(4),
  ISNUMBER VARCHAR2(1),
  QALIGN VARCHAR2(1)
)
;
alter table QUERY_CONFIG_SHOWFIELD
  add constraint PK_QUERY_CONFIG_SHOWFIELD primary key (ID);


create table QUERY_CONFIG_TABLE
(
  ID          VARCHAR2(8) not null,
  NAME        VARCHAR2(50),
  MAINTABLE   VARCHAR2(50),
  TYPE        CHAR(1),
  BID         VARCHAR2(8),
  IFFIRSTDATA VARCHAR2(1),
  IFMULSEL    VARCHAR2(1),
  IFCOMBTN    VARCHAR2(1),
  CID         VARCHAR2(8),
  DCODE       VARCHAR2(64),
  QITEMTYPE   VARCHAR2(1),
  QTABLETYPE  VARCHAR2(1)
)
;
alter table QUERY_CONFIG_TABLE
  add constraint PK_QUERY_CONFIG_TABLE primary key (ID);


create table QUERY_TMP
(
  USERID VARCHAR2(16) not null,
  TMP    VARCHAR2(500) null
)
;


create table QUERY_PARAMETER
(
  USERID VARCHAR2(16) null,
  QUERYID    VARCHAR2(8) null,
  UP_HEIGHT VARCHAR2(4) null,
  DOWN_HEIGHT  VARCHAR2(4) null
)
;

