. , , ,

,,,

,

һ

_________________________________ ..

33 , . 010501

_______________________________ ..

. .- . ,

2006

, .

44 , 3 , 10 , 10 .

: , , , , , .

, .

Delphi 7 InterBase 6.0 . .

, .


TOC o "1-3" p " " h z u . 4

1 . . 7

1.1 . 7

1.2 . 11

1.3 . 14

1.4 .............................. 16

1.5 ................................................................ 18

2 21

2.1 Delphi 21

2.1 InterBase 24

3 29

3.1 29

3.2 . 30

3.3 33

3.4 36

.................................................................................................... 37

. 39

SQL.. 40

, -, , -, - . , , , , . . 50 . , 300 .

, , , , , .

: , , , . , , . , . , , , . .

, , , . , . . , , , , , . . , , . , ( ) , ࠠ .

.

, , , , . (, , , ..).

, . , , .


1 .

1.1

, , . , , ; , .

, , , , .

, , . . , . , , - . , , , , , .

, ( , , ). , .

, , , . . . , . , , , .

. -, . -, , , . , , , . -, , , , , .

, , . . .

. . .

. , . , , , . , . . , , . , .

, , , . , , . , , . , , , . , .

, , . , , . , , .

, , (Paradox, DBase), (Acess, Oracle, FoxPro). .

, 1. , : ( ) . , . (, , , .).

SHAPE * MERGEFORMAT

1

1.2

, , 1970 . . , , . , " " , , 1970 . , .

"" 1985 , 12 ( 1), , .

1

1

.

2

, , .

3

. .

4

.

5

-

-.

6

, ().

7

.

8

.

9

( ) .

10

, .

11

() .

12

.

. : , , , , .

, . (, ). () (). : .

, , . , . . : , .

. , . , , . , , .

, , , . . , .

, , , , , - , , .

, . , . - :

- ;

- ;

- ;

- .

:

- ;

- ;

- ;

- .

() ( , , - ..).

1.3

. . , , .

, . , .

, -, . , , . . , , . .

: , .

, . , , , , , . , .

, .

: , , , . , , .

: , , . , .

1.4

.

: . . . . , . .

: , , , . , .

: , .

: , , , .

: .

: , , , .

: . , , . , , .

: , - , , . , , , , .

: . . . . , , .

: , , . , .

- , , .

1.5

ANSI/SPARC :

- , ;

- , ;

- , , ;

, , , , , , .

. , ( ). . , , , .

: - , , . , , . SQL. (DDL), , (DML), .

, , . . . .

. .

, : . , , .

. , . - , . , , .


2

2.1 Delphi

, , , . , , , . , . , , , .

Delphi . Delphi , Delphi , , . Delphi- , ( ).

, Delphi , , , , , .

Delphi Borland Database Engine (BDE). Integrated Database Application Programming Interface (IDAPI). BDE record- () , set- , SQL- . BDE, Delphi , (, , ) Open DataBase Connectivity (ODBC) Microsoft. , , BDE , ODBC. ODBC ODBC socket, BDE.

Borland - Paradox, DBase, Database Desktop - BDE. , Paradox DBase, BDE, Delphi. BDE , 2.

2 BDE Administrator

, . - Borland Database Engine. , , , . , , , ..

. , ( , ), , (InterBase).

Delphi SQL Borland Database Engine. Delphi Borland SQL Link, Oracle, Sybase, Informix InterBase . , Delphi InterBase , SQL- . Delphi, , .dbf ( dBase Clipper) .db (Paradox). InterBase for Windows 4.0 ( SQL-, ), -.

Delphi . Delphi , . . , , .

, . Delphi. , ( ) .

(data source) , . : . Delphi datasource.

. Delphi . .

Delphi tdataset, . , . tdataset , () . , tdataset ( tdataset, -).

2.2 InterBase

InterBase - , BORLAND - : .

Delphi InterBase Windows - Local InterBase. Local InterBase , -, . () , . , Local InterBase Paradox dBase.

InterBase ( 2), . InterBase , , InterBase, : TCP/IP, NetNEUI, IPX/SPX.

2 .

SQL-, .

, .

InterBase 6.0

0.2 0.7

3.5

Paradox + MS ODBC

~ 5 28

~ 104

Access + MS Jet 4.0

0.2 1.0

~ 80

DBISAM 2.04

3.0 3.5

2.0 3.0

InterBase , ( ). , (transaction log), , InterBase .
InterBase . , , , . .

InterBase ANSI SQL 92, SQL . , InterBase : , , , . InterBase , , , (event alerters), BLOB-. , , , , , , InterBase.

InterBase Interactive SQL, , , .

InterBase SQL- User Defined Functions, :

- : , , , ;

- : , , ;

- : . , , .

BLOB- BLOB-. InterBase , Intranet-, .

InterBase , , , , , . (). , (system tables). , . "RDB$". - RDB$RELATIONS, .

, . , , , . InterBase, .

, - , . . , . , , . SQL- (, ).

, InterBase, . , , - , , , , , ( rtf) OLE (Object Linking and Embedding) Micrsoft. , .


3

3.1

. , , , . . . . . , . DDL , DML . / . , . :

- . , , CAS, ;

- ;

- ;

- ;

- , CAS ;

- ;

- ;

- , .

3.2

.

.

1.         (1, , CAS, )

. , . 1 - , . , .

2.         (2, 1, )

. , , : 2 - , ; 1 - , . , . .

3.         (1, , , , , , , )

4.         (1, , , , , , , )

5.         (1, , , , , , )

6.         (1, , , , , , )

7.         (1, , , , , , , , , )

1 .

8.         (3, , )

, .

3 ER :

3 ER-

, , -- -- .

, . , , .

, . , , . .

3.3

- InterBase. , . . , , . InterBase - , SQL. . , , - .

8- . .

3 (Elements) .

3 Elements

Num1

Integer

()

#CAS

Char[10]

CAS

Formula

VarChar[30]

Name

VarChar[200]

4 (Synonyms)

4 Synonyms

Num2

Integer

()

Num1

Integer

( )

Synonym

VarChar[200]

5 (Workzone) .

5 Workzone

Num1

Integer

()

Data

SmallInt

Class

Integer

PDK

Decimal(4,3)

OBUV

Decimal(4,3)

Condition

VarChar[30]

Influence

VarChar[500]

Additions

VarChar[500]

6 (Livezone) .

6 Livezone

Num1

Integer

()

Data

SmallInt

Class

Integer

PDKm

Decimal(4,3)

PDKd

Decimal(4,3)

OBUV

Decimal(4,3)

Limit

VarChar[30]

Additions

VarChar[500]

7 (Water) - - .

7 Water

Num1

Integer

()

Data

SmallInt

Class

Integer

PDK

Decimal(4,3)

ODU

Decimal(4,3)

Limit

VarChar[30]

Additions

VarChar[500]

8 (Ground) .

8 Ground

Num1

Integer

()

Data

SmallInt

PDKf

Decimal(4,3)

ODK

Decimal(4,3)

Limit

VarChar[30]

Method

VarChar[500]

Additions

VarChar[500]

9 (Fishing) - - .

9 Fishing

Num1

Integer

()

Data

SmallInt

Class

Integer

PDK

Decimal(4,3)

OBUV

Decimal(4,3)

Limit

VarChar[30]

Doc

VarChar[500]

Updates

VarChar[500]

Method

VarChar[500]

Additions

VarChar[500]

10 (Help) .

10 Help

Num3

Integer

()

Topic

Char[10]

( )

Link

BLOB

,

3.4

, , . . Delphi 7.0 , .

, .. , , , . , , , SQL- . . , . .

Delphi 7. , .

, . (, , , ..).

, , .

Delphi 7.0 Windows , , , , .

( ). , . , . , . , , .

.. , , , , .


1.     . . . : . . 6- . .: , 1998. 784 .

2.     . . Delphi. .: -, 2004. 880 .

3.     . . , . .: . . . , 2001. 144 .

4.     12.01.007-76. . . .

5.     Codd S.B. Codd C.T. Providing OLAP (On-Line Analytical Processing) to User-Analysts: An IT Mandate. CA.: E.F.Codd & Associates, 1993. 851 p.

6.     . MySQL. .: , 2004. 1056 .

7.     Borland Delphi 7 Help: Developing Database Applications, IBExpert Reference

8.     InterBase Documentation: Data Definition Guide, Developers Guide

9.     http://www.minzdrav-rf.ru

10.           http://www.ecolportal.ru


SQL

CREATE DATABASE 'E:NORM.GDB'

USER 'MAX' PASSWORD '129'

PAGE_SIZE = 8192

DEFAULT CHARACTER SET WIN1251;

CREATE DOMAIN TBOOLEAN AS

SMALLINT

NOT NULL

CHECK (VALUE=0 OR VALUE=1);

CREATE DOMAIN TDIGIT AS

SMALLINT

CHECK (VALUE>0 AND VALUE<5);

CREATE DOMAIN TINTEGER AS

INTEGER

NOT NULL

CHECK (VALUE>0);

CREATE DOMAIN TREAL AS

DECIMAL(8,4)

CHECK (VALUE>0);

CREATE DOMAIN TSTRING10 AS

CHAR(10) CHARACTER SET WIN1251

COLLATE WIN1251;

CREATE DOMAIN TSTRING200 AS

VARCHAR(200) CHARACTER SET WIN1251

NOT NULL

COLLATE PXW_CYRL;

CREATE DOMAIN TSTRING30 AS

VARCHAR(30) CHARACTER SET WIN1251

COLLATE WIN1251;

CREATE DOMAIN TSTRING500 AS

VARCHAR(500);

CREATE GENERATOR COUNTER1;

SET GENERATOR COUNTER1 TO 1;

CREATE GENERATOR COUNTER2;

SET GENERATOR COUNTER2 TO 1;

CREATE GENERATOR COUNTER3;

SET GENERATOR COUNTER3 TO 1;

SET TERM ^ ;

CREATE PROCEDURE COUNTER1VALUE

RETURNS (

NUM INTEGER)

AS

begin

NUM = GEN_ID(COUNTER1, 1);

suspend;

end

^

SET TERM ; ^

DESCRIBE PROCEDURE COUNTER1VALUE '';

SET TERM ^ ;

CREATE PROCEDURE COUNTER2VALUE

RETURNS (

NUM INTEGER)

AS

begin

NUM = GEN_ID(COUNTER2, 1);

suspend;

end

^

SET TERM ; ^

DESCRIBE PROCEDURE COUNTER2VALUE '';

SET TERM ^ ;

CREATE PROCEDURE COUNTER3VALUE

RETURNS (

NUM INTEGER)

AS

begin

NUM=GEN_ID(COUNTER3, 1);

suspend;

end

^

SET TERM ; ^

DESCRIBE PROCEDURE COUNTER3VALUE '';

CREATE TABLE ELEMENTS (

NUM1 TINTEGER NOT NULL,

NAME TSTRING200 NOT NULL,

CAS TSTRING10,

FORMULA TSTRING30);

alter table ELEMENTS

add constraint PK_ELEMENTS

primary key (NUM1);

CREATE TABLE SYNONYMS (

NUM2 TINTEGER NOT NULL,

NUM1 TINTEGER NOT NULL,

SYNONYM TINTEGER);

alter table SYNONYMS

add constraint PK_SYNONYMS

primary key (NUM2,NUM1);

alter table SYNONYMS

add constraint FK_SYNONYMS_1

foreign key (NUM1)

references ELEMENTS(NUM1)

on update CASCADE;

CREATE TABLE WORKZONE (

NUM1 TINTEGER NOT NULL,

DATA TBOOLEAN NOT NULL,

CLASS TDIGIT,

PDK TREAL,

OBUV TREAL,

CONDITION TSTRING30,

INFLUENCE TSTRING500,

ADDITIONS TSTRING500);

alter table WORKZONE

add constraint PK_WORKZONE

primary key (NUM1);

alter table WORKZONE

add constraint FK_WORKZONE_1

foreign key (NUM1)

references ELEMENTS(NUM1);

CREATE TABLE LIVEZONE (

NUM1 TINTEGER NOT NULL,

DATA TBOOLEAN NOT NULL,

CLASS TDIGIT,

PDKM TREAL,

PDKD TREAL,

OBUV TREAL,

LIMIT TSTRING30,

ADDITIONS TSTRING500);

alter table LIVEZONE

add constraint PK_LIVEZONE

primary key (NUM1);

alter table LIVEZONE

add constraint FK_LIVEZONE_1

foreign key (NUM1)

references ELEMENTS(NUM1);

CREATE TABLE WATER (

NUM1 TINTEGER NOT NULL,

DATA TBOOLEAN NOT NULL,

CLASS TDIGIT,

PDK TREAL,

ODU TREAL,

LIMIT TSTRING30,

ADDITIONS TSTRING500);

alter table WATER

add constraint PK_WATER

primary key (NUM1);

alter table WATER

add constraint FK_WATER_1

foreign key (NUM1)

references ELEMENTS(NUM1);

CREATE TABLE GROUND (

NUM1 TINTEGER NOT NULL,

DATA TBOOLEAN NOT NULL,

PDKF TREAL,

ODK TREAL,

LIMIT TSTRING30,

METHOD TSTRING500,

ADDITIONS TSTRING500);

alter table GROUND

add constraint PK_GROUND

primary key (NUM1);

alter table GROUND

add constraint FK_GROUND_1

foreign key (NUM1)

references ELEMENTS(NUM1);

CREATE TABLE FISHING (

NUM1 TINTEGER NOT NULL,

DATA TBOOLEAN NOT NULL,

CLASS TDIGIT,

PDK TREAL,

OBUV TREAL,

LIMIT TSTRING30,

DOC TSTRING500,

UPDATES TSTRING500,

METHOD TSTRING500,

ADDITIONS TSTRING500);

alter table FISHING

add constraint PK_FISHING

primary key (NUM1);

alter table FISHING

add constraint FK_FISHING_1

foreign key (NUM1)

references ELEMENTS(NUM1);

CREATE TABLE HELPS (

NUM3 TINTEGER NOT NULL,

TOPIC TSTRING10,

LINK BLOB SUB_TYPE 0 SEGMENT SIZE 80 NOT NULL);

alter table HELPS

add constraint PK_HELPS

primary key (NUM3);

һ

 

 

 

! , , , .
. , :