SQL数据库外文翻译

SQL数据库外文翻译
SQL数据库外文翻译

Working with Databases

This chapter describes how to use SQL statements in embedded applications to control databases. There are three database statements that set up and open databases for access: SET DATABASE declares a database handle, associates the handle with an actual database file, and optionally assigns operational parameters for the database.

SET NAMES optionally specifies the character set a client application uses for CHAR, VARCHAR, and text Blob data. The server uses this information to

transli terate from a database?s default character set to the client?s character set on SELECT operations, and to transliterate from a client application?s character set to the database character set on INSERT and UPDATE operations.

g CONNECT opens a database, allocates system resources for it, and optionally assigns operational parameters for the database.All databases must be closed before a program ends. A database can be closed by using DISCONNECT, or by appending the RELEASE option to the final COMMIT or ROLLBACK in a program. Declaring a database

Before a database can be opened and used in a program, it must first be declared with SET DATABASE to:

CHAPTER 3 WORKING WITH DATABASES. Establish a database handle. Associate the database handle with a database file stored on a local or remote node.A database handle is a unique, abbreviated alias for an actual database name. Database handles are used in subsequent CONNECT, COMMIT RELEASE, and ROLLBACK RELEASE statements to specify which databases they should affect. Except in dynamic SQL (DSQL) applications, database handles can also be used inside transaction blocks to qualify, or differentiate, table names when two or more open databases contain identically named tables.

Each database handle must be unique among all variables used in a program. Database handles cannot duplicate host-language reserved words, and cannot be InterBase reserved words.The following statement illustrates a simple database declaration:

EXEC SQL

SET DATABASE DB1 = ?employee.gdb?;

This database declaration identifies the database file, employee.gdb, as a database the program uses, and assigns the database a handle, or alias, DB1.

If a program runs in a directory different from the directory that contains the database file, then the file name specification in SET DATABASE must include a full path name, too. For example, the following SET DATABASE declaration specifies the full path to employee.gdb:

EXEC SQL

SET DATABASE DB1 = ?/interbase/examples/employee.gdb?;

If a program and a database file it uses reside on different hosts, then the file name specification must also include a host name. The following declaration illustrates how a Unix host name is included as part of the database file specification on a TCP/IP network:

EXEC SQL

SET DATABASE DB1 = ?jupiter:/usr/interbase/examples/employee.gdb?;

On a Windows network that uses the Netbeui protocol, specify the path as follows: EXEC SQL

SET DATABASE DB1 = ?//venus/C:/Interbase/examples/employee.gdb?; DECLARING A DATABASE

EMBEDDED SQL GUIDE 37

Declaring multiple databases

An SQL program, but not a DSQL program, can access multiple databases at the same time. In multi-database programs, database handles are required. A handle is used to:

1. Reference individual databases in a multi-database transaction.

2. Qualify table names.

3. Specify databases to open in CONNECT statements.

Indicate databases to close with DISCONNECT, COMMIT RELEASE, and ROLLBACK RELEASE.

DSQL programs can access only a single database at a time, so database handle use is restricted to connecting to and disconnecting from a database.

In multi-database programs, each database must be declared in a separate SET DATABASE statement. For example, the following code contains two SET DATABASE statements:

. . .

EXEC SQL

SET DATABASE DB2 = ?employee2.gdb?;

EXEC SQL

SET DATABASE DB1 = ?employee.gdb?;

. . .

4Using handles for table names

When the same table name occurs in more than one simultaneously accessed database, a database handle must be used to differentiate one table name from another. The database handle is used as a prefix to table names, and takes the form

handle.table.

For example, in the following code, the database handles, TEST and EMP, are used to distinguish between two tables, each named EMPLOYEE:

. . .

EXEC SQL

DECLARE IDMATCH CURSOR FOR

SELECT TESTNO INTO :matchid FROM TEST.EMPLOYEE

WHERE TESTNO > 100;

EXEC SQL

DECLARE EIDMATCH CURSOR FOR

SELECT EMPNO INTO :empid FROM EMP.EMPLOYEE

WHERE EMPNO = :matchid;

. . .

CHAPTER 3 WORKING WITH DATABASES

38 INTERBASE 6

IMPORTANT

This use of database handles applies only to embedded SQL applications. DSQL applications cannot access multiple databases simultaneously.

4Using handles with operations

In multi-database programs, database handles must be specified in CONNECT statements to identify which databases among several to open and prepare for use in subsequent transactions.

Database handles can also be used with DISCONNECT, COMMIT RELEASE, and ROLLBACK

RELEASE to specify a subset of open databases to close.To open and prepare a database w ith CONNECT, see “Opening a database” on page 41.To close a database with DISCONNECT, COMMIT RELEASE, or ROLLBACK RELEASE, see“Closing a database” on page 49. To learn more about using database handles in transactions, see “Accessing an open database” on p age 48.

Preprocessing and run time databases

Normally, each SET DATABASE statement specifies a single database file to associate with a handle. When a program is preprocessed, gpre uses the specified file to validate the program?s table and column referenc es. Later, when a user runs the program, the same database file is accessed. Different databases can be specified for preprocessing and run time when necessary.4Using the COMPILETIME clause A program can be designed to run against any one of several identically structured databases. In other cases, the actual database that a program will use at runtime is not available when a program is preprocessed and compiled. In such cases, SET DATABASE can include a COMPILETIME clause to specify a database for gpre to test against during preprocessing. For example, the following SET DATABASE statement declares that employee.gdb is to be used by gpre during preprocessing: EXEC SQL

SET DATABASE EMP = COMPILETIME ?employee.gdb?;

IMPORTANT

The file specification that follows the COMPILETIME keyword must always be a hard-coded, quoted string.

DECLARING A DATABASE

EMBEDDED SQL GUIDE 39

When SET DATABASE uses the COMPILETIME clause, but no RUNTIME clause, and does not specify a different database file specification in a subsequent CONNECT statement, the same database file is used both for preprocessing and run time. To specify different preprocessing and runtime databases with SET DATABASE, use both the COMPILETIME and

RUNTIME clauses.

4Using the RUNTIME clause

When a database file is specified for use during preprocessing, SET DATABASE can specify a different database to use at run time by including the RUNTIME keyword and a runtime file specification:

EXEC SQL

SET DATABASE EMP = COMPILETIME ?employee.gdb?

RUNTIME ?employee2.gdb?;

The file specification that follows the RUNTIME keyword can be either a

hard-coded, quoted string, or a host-language variable. For example, the following C code fragment prompts the user for a database name, and stores the name in a variable that is used later in SET DATABASE:

. . .

char db_name[125];

. . .

printf("Enter the desired database name, including node and path):\n");

gets(db_name);

EXEC SQL

SET DATABASE EMP = COMPILETIME ?employee.gdb? RUNTIME : db_name; . . .

Note host-language variables in SET DATABASE must be preceded, as always, by a colon.

Controlling SET DATABASE scope

By default, SET DATABASE creates a handle that is global to all modules in an application.

A global handle is one that may be referenced in all host-language modules comprising the program. SET DATABASE provides two optional keywords to change the scope of a declaration:

g STATIC limits declaration scope to the module containing the SET DATABASE statement. No other program modules can see or use a database handle declared STATIC.

CHAPTER 3 WORKING WITH DATABASES

40 INTERBASE 6

EXTERN notifies gpre that a SET DATABASE statement in a module duplicates a globally-declared database in another module. If the EXTERN keyword is used, then another module must contain the actual SET DATABASE statement, or an error occurs during compilation.

The STATIC keyword is used in a multi-module program to restrict database handle access to the single module where it is declared. The following example illustrates the use of the

STATIC keyword:

EXEC SQL

SET DATABASE EMP = STATIC ?employee.gdb?;

The EXTERN keyword is used in a multi-module program to signal that SET DATABASE in one module is not an actual declaration, but refers to a declaration made in a different module. Gpre uses this information during preprocessing. The following example illustrates the use of the EXTERN keyword:

EXEC SQL

SET DATABASE EMP = EXTERN ?employee.gdb?;

If an application contains an EXTERN reference, then when it is used at run time, the actual SET DATABASE declaration must be processed first, and the database connected before other modules can access it.

A single SET DATABASE statement can contain either the STATIC or EXTERN keyword, but not both. A scope declaration in SET DATABASE applies to both COMPILETIME and RUNTIME databases.

Specifying a connection character set

When a client application connects to a database, it may have its own character set requirements. The server providing database access to the client does not know about these requirements unless the client specifies them. The client application specifies its character set requirement using the SET NAMES statement before it connects to the database.

SET NAMES specifies the character set the server should use when translating data from the database to the client application. Similarly, when the client sends data to the database, the server translates the data from the client?s character set to the database?s default character set (or the character set for an individual column if it differs from the databas e?s default character set). For example, the following statements specify that the client is using the DOS437 character set, then connect to the database:

EXEC SQL

OPENING A DATABASE

EMBEDDED SQL GUIDE 41

SET NAMES DOS437;

EXEC SQL

CONNECT ?europe.gdb? USER ?JAMES? PASSWORD ?U4EEAH?;

For more information about character sets, see the Data Definition Guide. For the complete syntax of SET NAMES and CONNECT, see the Language Reference. Opening a database

After a database is declared, it must be attached with a CONNECT statement before it can be used. CONNECT:

1. Allocates system resources for the database.

2. Determines if the database file is local, residing on the same host where the application itself is running, or remote, residing on a different host.

3. Opens the database and examines it to make sure it is valid.

InterBase provides transparent access to all databases, whether local or remote. If the database structure is invalid, the on-disk structure (ODS) number does not correspond to the one required by InterBase, or if the database is corrupt, InterBase reports an error, and permits no further access. Optionally, CONNECT can be used to specify:

4. A user name and password combination that is checked against the server?s security database before allowing the connect to succeed. User names can be up to 31 characters.

Passwords are restricted to 8 characters.

5. An SQL role name that the user adopts on connection to the database, provided that the user has previously been granted membership in the role. Regardless of role memberships granted, the user belongs to no role unless specified with this ROLE clause.

The client can specify at most one role per connection, and cannot switch roles except by reconnecting.

6. The size of the database buffer cache to allocate to the application when the default cache size is inappropriate.

Using simple CONNECT statements

In its simplest form, CONNECT requires one or more database parameters, each specifying the name of a database to open. The name of the database can be a: Database handle declared in a previous SET DATABASE statement.

CHAPTER 3 WORKING WITH DATABASES

42 INTERBASE 6

1. Host-language variable.

2. Hard-coded file name.

4Using a database handle

If a program uses SET DATABASE to provide database handles, those handles should be used in subsequent CONNECT statements instead of hard-coded names. For example,

. . .

EXEC SQL

SET DATABASE DB1 = ?employee.gdb?;

EXEC SQL

SET DATABASE DB2 = ?employee2.gdb?;

EXEC SQL

CONNECT DB1;

EXEC SQL

CONNECT DB2;

. . .

There are several advantages to using a database handle with CONNECT:

1. Long file specifications can be replaced by shorter, mnemonic handles.

2. Handles can be used to qualify table names in multi-database transactions. DSQL applications do not support multi-database transactions.

3. Handles can be reassigned to other databases as needed.

4. The number of database cache buffers can be specified as an additional CONNECT parameter.

For more information about setting the number of database cache buffers, see “Setting d atabase cache buffers” on page 47. 4Using strings or host-language variables Instead of using a database handle, CONNECT can use a database name supplied at run time. The database name can be supplied as either a host-language variable or a hard-coded, quoted string.

The following C code demonstrates how a program accessing only a single database might implement CONNECT using a file name solicited from a user at run time:

. . .

char fname[125];

. . .

printf(?Enter the desired database name, including node

and path):\n?);

OPENING A DATABASE

EMBEDDED SQL GUIDE 43

gets(fname);

. . .

EXEC SQL

CONNECT :fname;

. . .

Tip

This technique is especially useful for programs that are designed to work with many identically structured databases, one at a time, such as CAD/CAM or architectural databases.

MULTIPLE DATABASE IMPLEMENTATION

To use a database specified by the user as a host-language variable in a CONNECT statement in multi-database programs, follow these steps:

1. Declare a database handle using the following SET DATABASE syntax:

EXEC SQL

SET DATABASE handle = COMPILETIME ? dbname?;

Here, handle is a hard-coded database handle supplied by the programmer, dbname

is a quoted, hard-coded database name used by gpre during preprocessing.

2. Prompt the user for a database to open.

3. Store the database name entered by the user in a host-language variable.

4. Use the handle to open the database, associating the host-language variable with the handle using the following CONNECT syntax:

EXEC SQL

CONNECT : variable AS handle;

The following C code illustrates these steps:

. . .

char fname[125];

. . .

EXEC SQL

SET DATABASE DB1 = ?employee.gdb?;

printf("Enter the desired database name, including node

and path):\n");

gets(fname);

EXEC SQL

CONNECT :fname AS DB1;

. . .

CHAPTER 3 WORKING WITH DATABASES

44 INTERBASE 6

In this example, SET DATABASE provides a hard-coded database file name for preprocessing with gpre. When a user runs the program, the database specified in the variable, fname, is used instead. 4Using a hard-coded database names

IN SINGE-DATABASE PROGRAMS

In a single-database program that omits SET DATABASE, CONNECT must contain a hard-coded, quoted file name in the following format:

EXEC SQL

CONNECT ?[ host[ path]] filename?; host is required only if a program and a dat abase file it uses reside on different nodes.

Similarly, path is required only if the database file does not reside in the current working directory. For example, the following CONNECT statement contains a

hard-coded file name that includes both a Unix host name and a path name:

EXEC SQL

CONNECT ?valdez:usr/interbase/examples/employee.gdb?;

Note Host syntax is specific to each server platform.

IMPORTANT A program that accesses multiple databases cannot use this form of CONNECT.

IN MULTI-DATABASE PROGRAMS

A program that accesses multiple databases must declare handles for each of them in separate SET DATABASE statements. These handles must be used in subsequent CONNECT statements to identify specific databases to open:

. . .

EXEC SQL

SET DATABASE DB1 = ?employee.gdb?;

EXEC SQL

SET DATABASE DB2 = ?employee2.gdb?;

EXEC SQL

CONNECT DB1;

EXEC SQL

CONNECT DB2;

. . .

Later, when the program closes these databases, the database handles are no longer in use. These handles can be reassigned to other databases by hard-coding a file name in a subsequent CONNECT statement. For example,

OPENING A DATABASE

EMBEDDED SQL GUIDE 45

. . .

EXEC SQL

DISCONNECT DB1, DB2;

EXEC SQL

CONNECT ?project.gdb? AS DB1;

. . .

Additional CONNECT syntax

CONNECT supports several formats for opening databases to provide programming flexibility. The following table outlines each possible syntax, provides descriptions and examples, and indicates whether CONNECT can be used in programs that access single or multiple databases:

For a complete discussion of CONNECT syntax and its uses, see the Language Reference.

Syntax Description Example

Single access

Multiple access

CONNECT …dbfile?; Opens a single, hard-coded database file, dbfile.

EXEC SQL

CONNECT …employee.gdb?;

Yes No

CONNECT handle; Opens the database file associated with a previously declared database handle. This is the preferred CONNECT syntax.

EXEC SQL

CONNECT EMP;

Yes Yes

CONNECT …dbfile? AS handle;

Opens a hard-coded database file, dbfile, and assigns a previously declared database handle to it.

EXEC SQL

CONNECT …employee.gdb?

AS EMP;

Yes Yes CONNECT :varname AS handle;

Opens the database file stored in the host-language variable, varname, and assigns a previously declared database handle to it.

EXEC SQL CONNECT :fname AS EMP;

Yes Yes

TABLE 3.1 CONNECT syntax summary

CHAPTER 3 WORKING WITH DATABASES

46 INTERBASE 6

Attaching to multiple databases

CONNECT can attach to multiple databases. To open all databases specified in previous SET

DATABASE statements, use either of the following CONNECT syntax options: EXEC SQL

CONNECT ALL;

EXEC SQL

CONNECT DEFAULT;

CONNECT can also attach to a specified list of databases. Separate each database request from others with commas. For example, the following statement opens two databases specified by their handles:

EXEC SQL

CONNECT DB1, DB2;

The next statement opens two hard-coded database files and also assigns them to previously declared handles:

EXEC SQL

CONNECT ?employee.gdb? AS DB1, ?employee2.gdb? AS DB2;

Tip Opening multiple databases with a single CONNECT is most effective when a program?s database access is simple and clear. In complex programs that open and close several databases, that substitute database names with host-language variables, or that assign multiple handles to the same database, use separate CONNECT statements to make program code easier to read, debug, and modify.

Handling CONNECT errors. The WHENEVER statement should be used to trap and handle runtime errors that occur during database declaration. The following C code fragment illustrates an error-handling routine that displays error messages and ends the program in an orderly fashion:

. . .

EXEC SQL

WHENEVER SQLERROR

GOTO error_exit;

. . .

OPENING A DATABASE

EMBEDDED SQL GUIDE 47

:error_exit

isc_print_sqlerr(sqlcode, status_vector);

EXEC SQL

DISCONNECT ALL;

exit(1);

. . .

For a complete discussion of SQL error handling, see Chapter 12, “Error Handling and Recovery.”

数据库的工作

这章描述怎样使用在嵌入式应用过程中的SQL语句控制数据库。有3 个数据库陈述建立并且打开进入的数据库:确定数据库宣布一数据库经营,把这个柄与一真实数据库文件联系起来,并且选择分配给数据库的操作的参数。

确定名字选择指定客户应用为CHAR,VARCHAR 和正文一些数据使用的字符集。服务器使用这信息从形成客户性质从而选择经营的一数据库反映性质直译,从应用性质和更新操作的数据库的一客户那里直译。连结打开数据库,分配去它的系统资源,并且选择因那些数据库而分配操作参数。在一个程序结束之前,全部数据库必须被关闭。一数据库可能通过使用不连接或者在附加选择对最后做的释放或者在一个程序内的返回而被关闭。

宣布数据库

在数据库之前可能被打开并且被在计划内使用,它必须首先确定数据库被宣布:

第三章数据库的工作确定数据库操作。联系数据库与文件关于一地方和遥远节点储存的一数据库一起经营。一数据库处理一独特,缩写的别名适合一真实数据库名字。数据库处理被使用在过程中随后连结,做释放,和随后释放陈述指定他们影响哪数据库。除了在动态的SQL(DSQL) 应用里,数据库处理也能在相互联系里面使用使有合格的块,或者使有差异,表格是当打开两个数据库或更多包含同等命名的表格什么时候的名字。

每个数据库处理一定在一个计划内使用的全部变量中是独特的。数据库经营不能复制主语言保留字,并且不能是InterBase 保留字。以下的陈述说明一个简单的数据库宣告:

EXEC SQL

SET DATABASE DB1 = ’employee.gdb’;

宣告数据库这鉴定那些文件数据库,employee. gdb,作为那些计划使用,并且分配那些数据库一个处理或者别名,DB1的数据库。

如果一个程序在一份不同于包含数据库文件的目录里运转,然后那些说明文件名在数据库也必须包括全部路径名。例如,确定宣告指定全部的数据库的那些如下内容通向的路径employee.gdb:

EXEC SQL

SET DATABASE DB1 = ’/interbase/examples/employee.gdb’;

如果它使用的一个程序和一个数据库文件保存在不同的主人,然后文件名说明也必须包括一个主机名。以下的宣告说明一个Unix主机名怎样被作为关于一个传输控制协议/网际协议网络的数据库文件说明表的部分包括:

EXEC SQL

SET DATABASE DB1 = ’jupiter:/usr/interbase/examples/employee.gdb’;在使用Netbeui 协议的一个Windows 网络上,指定道路如下:

EXEC SQL

SET DATABASE DB1 = ’//venus/C:/Interbase/examples/employee.gdb’;

宣布数据库嵌入SQL指南

宣布多数据库

一个SQL程序,但不是一个DSQL程序,能同时访问多数据库。在多数据库的计划内,数据库处理被要求。习惯于:多数据库交易参考个别数据库。1.使表格有合理的名字。

2.指定数据库为打开并且连结状态。

3.表明,要接受的数据库没有连接,做释放,并且随后释放。 DSQL 计划能访问单一数据库只一次,数据库处理使用连接并且从数据库那里拆开限制。

在多数据库计划内,不是每数据库都一定被宣布用一单独陈述数据库。例如,以下的代码包含两个固定的数据库陈述:

. . .

EXEC SQL

SET DATABASE DB2 = ’employee2.gdb’;

EXEC SQL

SET DATABASE DB1 = ’employee.gdb’;

. . .

当相同的表格名字在不止一次同时访问的数据库发生时,使用为表格名字处理,数据库处理必须用来把一个表格名字和另一个区别开。数据库经营被用作给表格名字的一前缀,并且处理形式handle.table。例如,在以下代码内,数据库办理,测试和EMP,用来分清二张表格,每一个命名雇员:

. . .

EXEC SQL

DECLARE IDMATCH CURSOR FOR

SELECT TESTNO INTO :matchid FROM TEST.EMPLOYEE

WHERE TESTNO > 100;

EXEC SQL

DECLARE EIDMATCH CURSOR FOR

SELECT EMPNO INTO :empid FROM EMP.EMPLOYEE

WHERE EMPNO = :matchid;

. . .

这数据库的使用经营只申请嵌入SQL 应用。 DSQL 应用同时不能访问多数据库。

使用在多数据库的程序里用操作处理,数据库经营一定在里指定连结陈述鉴定哪几个中的数据库打开并且准备供随后交易使用。数据库处理被用于可能不连接,做释放,并且随后释放指定子集合的关闭的正在打开的数据库。

数据库有连结,看在第41 页上"数据库,打开"。数据库有拆开,做释放,或者随后释放,看在第49 页上" 数据库,关闭"。为了了解更多的数据库在连接过程中处理的使用,看在第48 页"访问开的数据库"。

预处理和运行时间数据库

通常,每个数据库陈述指定单一数据库文件同一个文件交往。当一个计划被预处理时,gpre使用被指定的文件批准计划的表格和专栏参考。过后,当一个用户运行程序时,相同的数据库文件被访问。不同的数据库必要时可能被指定预处理和运行时间。

使用COMPILETIME 条款,一个计划可能被用于撞上几同等组织的数据库中的任何人。在其他情况里,当一个计划被预处理并且编辑时,一个程序将在运行时间使用的实际数据库没有出现。在这样的情况内,确定,gpre测试,数据库包括条款COMPILETIME 指定数据库能在上在期间预处理。例如,规定数据库陈述的如下内容宣布employee.gdb将在预处理期间被gpre使用:

EXEC SQL

SET DATABASE EMP = COMPILETIME ’employee.gdb’;

遵循那些关键字COMPILETIME的那些文件说明表必须总是一个坚固编码,引用线。

什么时候被确定数据库使用COMPILETIME 条款,但是没有运行时间条款,并且没指定,不同数据库陆续编入说明一随后陈述,相同文件数据库被使用两个适合预处理和运行时间。预处理和数据库运行时间与一起确定数据库,使用那些COMPILETIME和条款运行时间。

使用运行时间条款,当一个数据库文件被供使用指定时,在预处理期间,确定数据库能指定要通过包括运行时间关键字和一张运行时间文件说明表在运行时间使用的不同的数据库:

EXEC SQL

SET DATABASE EMP = COMPILETIME ’employee.gdb’

RUNTIME ’employee2.gdb’;

遵循的那些文件说明表关键字可能的那些运行时间或者一坚固编码,引用线或者易变的主语言。例如,以下C 代码碎片促使给一数据库名字的用户,和储存名字在使用过后确定数据库的一变量内:

. . .

char db_name[125];

. . .

printf("Enter the desired database name, including node

and path):\n");

gets(db_name);

EXEC SQL

SET DATABASE EMP = COMPILETIME ’employee.gdb’ RUNTIME :db_name;

. . .

注意到主语言变量在确定数据库一定被在前,象往常一样,以冒号。

数据库的控制装置因错误,数据库创造对在应用过程中的全部模件全球的一个文件。全球文件可能在全部主语言内包括计划的模件确定数据库提供两个可选择的关键字改变一个宣告的范围:

静止限制宣告机会在控制包含定型的数据库状态。没有其他程序模块能看见或者使用一数据库处理宣布静止。

EXTERN 通知gpre一确定的数据库陈述在一模件内复制全球宣布的在另一模内的数据库。如果EXTERN关键字被使用,然后另一个模件必须包含实际确定数据库陈述,否则一个错误在编辑期间出现。静止关键字在限制数据库的一多模件计划内使用办理随着宣布在哪里的单个模件的进入。以下的例子说明使用静止的关键字:

EXEC SQL

SE T DATABASE EMP = STATIC ’employee.gdb’;

EXTERN关键字在用信号通知确定在一模件内的数据库的一多模件计划内使用不是一个真实宣告,但是指在一个不同的模件里做的一个宣告。 gpre在预处理期间使用这信息。以下的例子说明使用EXTERN关键字:

EXEC SQL

SET DATABASE EMP = EXTERN ’employee.gdb’;

如果应用包含EXTERN 参考,那么被在运行时间使用,实际确定数据库宣告必须被首先处理,并且在其他模件能访问它之前,数据库连结。一单独的数据库确定陈述能包含的数据库或者静止或者EXTERN关键字,但不是两个都是。宣告机会在确定数据库适用于COMPILETIME和数据库运行时间。

指定连接字符集

当客户应用连接数据库时,指定连接字符集,它可能有它自己的字符集要求。提供数据库进入在客户的服务器不了解这些要求除非客户指定他们。在它连接数据库之前,客户应用指定使用被确定的名字陈述的它的字符集要求。

当把数据从数据库翻译到客户应用时,确定名字指定服务器应该使用的字符集。与此类似,客户把数据送到数据库,开始数据库的默认字符集,服务器从客户的性格中翻译数据 ( 或者一个个别的专栏的字符集,如果它不同于数据库的默认字符集)。例如,以下的陈述确切说明客户正使用DOS437字符集,然后连接数据库:

EXEC SQL

OPENING A DATABASE

EMBEDDED SQL GUIDE 41

SET NAMES DOS437;

EXEC SQL

CONNECT ’europe.gdb’ USER ’JAMES’ PASSWORD ’U4EEAH’;

对更多的关于字符集的信息来说,看数据定义指南。完整句法确定名字并且连结,看那些参考语言。

打开一个数据库

在数据库被宣布之后,它一定附有的打开数据库一连结陈述在它可能被使用之前。

1.连结:为数据库分配系统资源。

2.确定,数据库文件如果为当地的,保存在应用它那里的相同主人,如果是遥远的,保存在不同主人。

外文翻译-数据库管理系统—剖析

Database Management System Source:Database and Network Journal Author:David Anderson You know that a data is a collection of logically related data elements that may be structured in various ways to meet the multiple processing and retrieval needs of orga nizations and individuals. There’s nothing new about data base-early ones were chiseled in stone, penned on scrolls, and written on index cards. But now database are commonly recorded on magnetically media, and computer programs are required to perform the necessary storage and retrieval operations. The system software package that handles the difficult tasks associated with created, accessing, and maintaining database records is in a DBMS package establish an interface between the database itself and the users of the database. (These users may be applications programmers, managers and others with information needs, and various OS programmers.) A DBMS can organize, process, and present selected data elements from the database. This capability enables decision makers to search. Probe, and query data contents in order to extract answers to nonrecurring and unplanned questions that aren’t available in regular reports. These questions might initially be vague and/or poorly defined, but people can “browse” through the database until they have the needed information. In short, the DBMS will “manage” the stored data items and assemble the needed items from the common database in response to the queries of those who aren’t programmers. In a file-oriented system, users needing special information may communicate their needs to a programmers, who, when time permits, will information. The availability of a DBMS, however, offers users a much faster alternative communications patch (see figure). Special, direct, and other file processing approaches ate used to organize and structure data in single files. But a DBMS is able to integrate data elements from several files to answer specific user inquiries fir information. This means that the DBMS is able to structure and tie together the logically related data from several large files. Logical structures. Identifying these logical relationships is a job of the data administrator. A data definition language is used for this purpose. The DBMS may

SQL数据库外文翻译--数据库的工作

Working with Databases This chapter describes how to use SQL statements in embedded applications to control databases. There are three database statements that set up and open databases for access: SET DATABASE declares a database handle, associates the handle with an actual database file, and optionally assigns operational parameters for the database. SET NAMES optionally specifies the character set a client application uses for CHAR, VARCHAR, and text Blob data. The server uses this information to transli terate from a database?s default character set to the client?s character set on SELECT operations, and to transliterate from a client application?s character set to the database character set on INSERT and UPDATE operations. g CONNECT opens a database, allocates system resources for it, and optionally assigns operational parameters for the database.All databases must be closed before a program ends. A database can be closed by using DISCONNECT, or by appending the RELEASE option to the final COMMIT or ROLLBACK in a program. Declaring a database Before a database can be opened and used in a program, it must first be declared with SET DATABASE to: CHAPTER 3 WORKING WITH DATABASES. Establish a database handle. Associate the database handle with a database file stored on a local or remote node.A database handle is a unique, abbreviated alias for an actual database name. Database handles are used in subsequent CONNECT, COMMIT RELEASE, and ROLLBACK RELEASE statements to specify which databases they should affect. Except in dynamic SQL (DSQL) applications, database handles can also be used inside transaction blocks to qualify, or differentiate, table names when two or more open databases contain identically named tables. Each database handle must be unique among all variables used in a program. Database handles cannot duplicate host-language reserved words, and cannot be InterBase reserved words.The following statement illustrates a simple database declaration:

企业数据建模外文翻译文献

企业数据建模外文翻译文献 (文档含中英文对照即英文原文和中文翻译) 翻译: 信息系统开发和数据库开发 在许多组织中,数据库开发是从企业数据建模开始的,企业数据建模确定了组织数据库的范围和一般内容。这一步骤通常发生在一个组织进行信息系统规划的过程中,它的目的是为组织数据创建一个整体的描述或解释,而不是设计一个特定的数据库。一个特定的数据库为一个或多个信息系统提供数据,而企业数据模型(可能包含许多数据库)描述了由组织维护的数据的范围。在企业数据建模时,你审查当前的系统,分析需要支持的业务领域的本质,描述需要进一步抽象的数据,并且规划一个或多个数据库开发项目。图1显示松谷家具公司的企业数据模型的一个部分。 1.1 信息系统体系结构 如图1所示,高级的数据模型仅仅是总体信息系统体系结构(ISA)一个部分或一个组

织信息系统的蓝图。在信息系统规划期间,你可以建立一个企业数据模型作为整个信息系统体系结构的一部分。根据Zachman(1987)、Sowa和Zachman(1992)的观点,一个信息系统体系结构由以下6个关键部分组成: 数据(如图1所示,但是也有其他的表示方法)。 操纵数据的处理(着系可以用数据流图、带方法的对象模型或者其他符号表示)。 网络,它在组织内并在组织与它的主要业务伙伴之间传输数据(它可以通过网络连接和拓扑图来显示)。 人,人执行处理并且是数据和信息的来源和接收者(人在过程模型中显示为数据的发送者和接收者)。 执行过程的事件和时间点(它们可以用状态转换图和其他的方式来显示)。 事件的原因和数据处理的规则(经常以文本形式显示,但是也存在一些用于规划的图表工具,如决策表)。 1.2 信息工程 信息系统的规划者按照信息系统规划的特定方法开发出信息系统的体系结构。信息工程是一种正式的和流行的方法。信息工程是一种面向数据的创建和维护信息系统的方法。因为信息工程是面向数据的,所以当你开始理解数据库是怎样被标识和定义时,信息工程的一种简洁的解释是非常有帮助的。信息工程遵循自顶向下规划的方法,其中,特定的信息系统从对信息需求的广泛理解中推导出来(例如,我们需要关于顾客、产品、供应商、销售员和加工中心的数据),而不是合并许多详尽的信息请求(如一个订单输入屏幕或按照地域报告的销售汇总)。自顶向下规划可使开发人员更全面地规划信息系统,提供一种考虑系统组件集成的方法,增进对信息系统与业务目标的关系的理解,加深对信息系统在整个组织中的影响的理解。 信息工程包括四个步骤:规划、分析、设计和实现。信息工程的规划阶段产生信息系统体系结构,包括企业数据模型。 1.3 信息系统规划 信息系统规划的目标是使信息技术与组织的业务策略紧密结合,这种结合对于从信息系统和技术的投资中获取最大利益是非常重要的。正如表1所描述的那样,信息工程方法的规划阶段包括3个步骤,我们在后续的3个小节中讨论它们。 1.确定关键性的规划因素

数据库外文参考文献及翻译.

数据库外文参考文献及翻译 数据库外文参考文献及翻译数据库管理系统——实施数据完整性一个数据库,只有用户对它特别有信心的时候。这就是为什么服务器必须实施数据完整性规则和商业政策的原因。执行SQL Server的数据完整性的数据库本身,保证了复杂的业务政策得以遵循,以及强制性数据元素之间的关系得到遵守。因为SQL Server的客户机/服务器体系结构允许你使用各种不同的前端应用程序去操纵和从服务器上呈现同样的数据,这把一切必要的完整性约束,安全权限,业务规则编码成每个应用,是非常繁琐的。如果企业的所有政策都在前端应用程序中被编码,那么各种应用程序都将随着每一次业务的政策的改变而改变。即使您试图把业务规则编码为每个客户端应用程序,其应用程序失常的危险性也将依然存在。大多数应用程序都是不能完全信任的,只有当服务器可以作为最后仲裁者,并且服务器不能为一个很差的书面或恶意程序去破坏其完整性而提供一个后门。SQL Server使用了先进的数据完整性功能,如存储过程,声明引用完整性(DRI),数据类型,限制,规则,默认和触发器来执行数据的完整性。所有这些功能在数据库里都有各自的用途;通过这些完整性功能的结合,可以实现您的数据库的灵活性和易于管理,而且还安全。声明数据完整性声明数据完整原文请找腾讯3249114六,维-论'文.网 https://www.360docs.net/doc/8f13104544.html, 定义一个表时指定构成的主键的列。这就是所谓的主键约束。SQL Server使用主键约束以保证所有值的唯一性在指定的列从未侵犯。通过确保这个表有一个主键来实现这个表的实体完整性。有时,在一个表中一个以上的列(或列的组合)可以唯一标志一行,例如,雇员表可能有员工编号( emp_id )列和社会安全号码( soc_sec_num )列,两者的值都被认为是唯一的。这种列经常被称为替代键或候选键。这些项也必须是唯一的。虽然一个表只能有一个主键,但是它可以有多个候选键。 SQL Server的支持多个候选键概念进入唯一性约束。当一列或列的组合被声明是唯一的, SQL Server 会阻止任何行因为违反这个唯一性而进行的添加或更新操作。在没有故指的或者合适的键存在时,指定一个任意的唯一的数字作为主键,往往是最有效的。例如,企业普遍使用的客户号码或账户号码作为唯一识别码或主键。通过允许一个表中的一个列拥有身份属性,SQL Server可以更容易有效地产生唯一数字。您使用的身份属性可以确保每个列中的值是唯一的,并且值将从你指定的起点开始,以你指定的数量进行递增(或递减)。(拥有特定属性的列通常也有一个主键或唯一约束,但这不是必需的。)第二种类型的数据完整性是参照完整性。 SQL Server实现了表和外键约束之间的逻辑关系。外键是一个表中的列或列的组合,连接着另一个表的主键(或着也可能是替代键)。这两个表之间的逻辑关系是关系模型的基础;参照完整性意味着这种关系是从来没有被违反的。例如,一个包括出版商表和标题表的简单的select例子。在标题表中,列title_id (标题编号)是主键。在出版商表,列pub_id (出版者ID )是主键。 titles表还包括一个pub_id列,这不是主键,因为出版商可以发布多个标题。相反, pub_id是一个外键,它对应着出版商表的主键。如果你在定义表的时候声明了这个关系, SQL Server由双方执行它。首先,它确保标题不能进入titles表,或在titles表中现有的pub_id无法被修改,除非有效的出版商ID作为新pub_id出现在出版商表中。其次,它确保在不考虑titles表中对应值的情况下,出版商表中的pub_id的值不做任何改变。以下两种方法可

外文文献翻译 An Introduction to Database Management System

英文翻译 数据库管理系统的介绍 Raghu Ramakrishnan 数据库(database,有时被拼作data base)又称为电子数据库,是专门组织起来的一组数据或信息,其目的是为了便于计算机快速查询及检索。数据库的结构是专门设计的,在各种数据处理操作命令的支持下,可以简化数据的存储、检索、修改和删除。数据库可以存储在磁盘、磁带、光盘或其他辅助存储设备上。 数据库由一个或一套文件组成,其中的信息可以分解为记录,每一条记录又包含一个或多个字段(或称为域)。字段是数据存取的基本单位。数据库用于描述实体,其中的一个字段通常表示与实体的某一属性相关的信息。通过关键字以及各种分类(排序)命令,用户可以对多条记录的字段进行查询,重新整理,分组或选择,以实体对某一类数据的检索,也可以生成报表。 所有数据库(除最简单的)中都有复杂的数据关系及其链接。处理与创建,访问以及维护数据库记录有关的复杂任务的系统软件包叫做数据库管理系统(DBMS)。DBMS软件包中的程序在数据库与其用户间建立接口。(这些用户可以是应用程序员,管理员及其他需要信息的人员和各种操作系统程序)DBMS可组织、处理和表示从数据库中选出的数据元。该功能使决策者能搜索、探查和查询数据库的内容,从而对正规报告中没有的,不再出现的且无法预料的问题做出回答。这些问题最初可能是模糊的并且(或者)是定义不恰当的,但是人们可以浏览数据库直到获得所需的信息。简言之,DBMS将“管理”存储的数据项和从公共数据库中汇集所需的数据项用以回答非程序员的询问。 DBMS由3个主要部分组成:(1)存储子系统,用来存储和检索文件中的数据;(2)建模和操作子系统,提供组织数据以及添加、删除、维护、更新数据的方法;(3)用户和DBMS之间的接口。在提高数据库管理系统的价值和有效性方面正在展现以下一些重要发展趋势: 1.管理人员需要最新的信息以做出有效的决策。 2.客户需要越来越复杂的信息服务以及更多的有关其订单,发票和账号的当前信息。

数据库设计外文翻译

外文翻译: 索引 原文来源:Thomas Kyte.Expert Oracle Database Architecture .2nd Edition. 译文正文: 什么情况下使用B*树索引? 我并不盲目地相信“法则”(任何法则都有例外),对于什么时候该用B*索引,我没有经验可以告诉你。为了证明为什么这个方面我无法提供任何经验,下面给出两种等效作法:?使用B*树索引,如果你想通过索引的方式去获得表中所占比例很小的那些行。 ?使用B *树索引,如果你要处理的表和索引许多可以代替表中使用的行。 这些规则似乎提供相互矛盾的意见,但在现实中,他们不是这样的,他们只是涉及两个极为不同的情况。有两种方式使用上述意见给予索引: ?作为获取表中某些行的手段。你将读取索引去获得表中的某一行。在这里你想获得表中所占比例很小的行。 ?作为获取查询结果的手段。这个索引包含足够信息来回复整个查询,我们将不用去查询全表。这个索引将作为该表的一个瘦版本。 还有其他方式—例如,我们使用索引去检索表的所有行,包括那些没有建索引的列。这似乎违背了刚提出的两个规则。这种方式获得将是一个真正的交互式应用程序。该应用中,其中你将获取其中的某些行,并展示它们,等等。你想获取的是针对初始响应时间的查询优化,而不是针对整个查询吞吐量的。 在第一种情况(也就是你想通过索引获得表中一小部分的行)预示着如果你有一个表T (使用与早些时候使用过的相一致的表T),然后你获得一个像这样查询的执行计划: ops$tkyte%ORA11GR2> set autotrace traceonly explain ops$tkyte%ORA11GR2> select owner, status 2 from t 3 where owner = USER; Execution Plan ---------------------------------------------------------- Plan hash value: 1049179052 ------------------------------------------------------------------ | Id | Operation | Name | Rows | Bytes | ------------------------------------------------------------------ | 0 | SELECT STATEMENT | | 2120 | 23320 | | 1 | TABLE ACCESS BY INDEX ROWID |T | 2120 | 23320 | | *2 | INDEX RANGE SCAN | DESC_T_IDX | 8 | | ------------------------------------------------------------------ Predicate Information (identified by operation id): --------------------------------------------------- 2 - access(SYS_OP_DESCEND("OWNER")=SYS_OP_DESCEND(USER@!)) filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("OWNER"))=USER@!) 你应该访问到该表的一小部分。这个问题在这里看是INDEX (RANGE SCAN) 紧跟在

大学毕业设计仓库管理系统数据库计算机外文参考文献原文及翻译

河北工程大学毕业论文(设计)英文参考文献原文复印件及译文 数据仓库 数据仓库为商务运作提供结构与工具,以便系统地组织、理解和使用数据进行决策。大量组织机构已经发现,在当今这个充满竞争、快速发展的世界,数据仓库是一个有价值的工具。在过去的几年中,许多公司已花费数百万美元,建立企业范围的数据仓库。许多人感到,随着工业竞争的加剧,数据仓库成了必备的最新营销武器——通过更多地了解客户需求而保住客户的途 径。“那么”,你可能会充满神秘地问,“到底什么是数据仓库?” 数据仓库已被多种方式定义,使得很难严格地定义它。宽松地讲,数据仓库是一个数据库,它与组织机构的操作数据库分别维护。数据仓库系统允许将各种应用系统集成在一起,为统一的历史数据分析提供坚实的平台,对信息处理提供支持。 按照W. H. Inmon,一位数据仓库系统构造方面的领头建筑师的说法,“数 (1) 视图。 (2)

般文件和联机事务处理记录,集成在一起。使用数据清理和数据集成技术,确保命名约定、编码结构、属性度量的一致性等。 (3)时变的:数据存储从历史的角度(例如,过去5-10 年)提供信息。数据仓库中的关键结构,隐式或显式地包含时间元素。 (4) 非易失的:数据仓库总是物理地分离存放数据;这些数据源于操作环境下的应用数据。由于这种分离,数据仓库不需要事务处理、恢复和并行控制机制。通常,它只需要两种数据访问:数据的初始化装入和数据访问。 概言之,数据仓库是一种语义上一致的数据存储,它充当决策支持数据模型的物理实现,并存放企业决策所需信息。数据仓库也常常被看作一种体系结构,通过将异种数据源中的数据集成在一起而构造,支持结构化和启发式查询、分析报告和决策制定。 “好”,你现在问,“那么,什么是建立数据仓库?” 根据上面的讨论,我们把建立数据仓库看作构造和使用数据仓库的过程。数据仓库的构造需要数据集成、数据清理、和数据统一。利用数据仓库常常需要一些决策支持技术。这使得“知识工人”(例如,经理、分析人员和主管)能够使用数据仓库,快捷、方便地得到数据的总体视图,根据数据仓库中的信息做出准确的决策。有些作者使用术语“建立数据仓库”表示构造数据仓库的过程,而用术语“仓库DBMS”表示管理和使用数据仓库。我们将不区分二者。 “组织机构如何使用数据仓库中的信息?”许多组织机构正在使用这些信息支持商务决策活动,包括: (1)、增加顾客关注,包括分析顾客购买模式(如,喜爱买什么、购买时间、预算周期、消费习惯); (2)、根据季度、年、地区的营销情况比较,重新配置产品和管理投资,调整生产策略; (3)、分析运作和查找利润源; (4)、管理顾客关系、进行环境调整、管理合股人的资产开销。 从异种数据库集成的角度看,数据仓库也是十分有用的。许多组织收集了形形色色数据,并由多个异种的、自治的、分布的数据源维护大型数据库。集成这些数据,并提供简便、有效的访问是非常希望的,并且也是一种挑战。数据库工业界和研究界都正朝着实现这一目标竭尽全力。 对于异种数据库的集成,传统的数据库做法是:在多个异种数据库上,建立一个包装程序和一个集成程序(或仲裁程序)。这方面的例子包括IBM 的数据连接程序和Informix的数据刀。当一个查询提交客户站点,首先使用元数据字典对查询进行转换,将它转换成相应异种站点上的查询。然后,将这些查询

外文文献之数据库信息管理系统简介

Introduction to database information management system The database is stored together a collection of the relevant data, the data is structured, non-harmful or unnecessary redundancy, and for a variety of application services, data storage independent of the use of its procedures; insert new data on the database , revised, and the original data can be retrieved by a common and can be controlled manner. When a system in the structure of a number of entirely separate from the database, the system includes a "database collection." Database management system (database management system) is a manipulation and large-scale database management software is being used to set up, use and maintenance of the database, or dbms. Its unified database management and control so as to ensure database security and integrity. Dbms users access data in the database, the database administrator through dbms database maintenance work. It provides a variety of functions, allows multiple applications and users use different methods at the same time or different time to build, modify, and asked whether the database. It allows users to easily manipulate data definition and maintenance of data security and integrity, as well as the multi-user concurrency control and the restoration of the database. Using the database can bring many benefits: such as reducing data redundancy, thus saving the data storage space; to achieve full sharing of data resources, and so on. In addition, the database technology also provides users with a very simple means to enable users to easily use the preparation of the database applications. Especially in recent years introduced micro-computer relational database management system dBASELL, intuitive operation, the use of flexible, convenient programming environment to extensive (generally 16 machine, such as IBM / PC / XT, China Great Wall 0520, and other species can run software), data-processing capacity strong. Database in our country are being more and more widely used, will be a powerful tool of economic management. The database is through the database management system (DBMS-DATA BASE MANAGEMENT SYSTEM) software for data storage, management and use of dBASELL is a database management system software. Information management system is the use of data acquisition and transmission technology, computer network technology, database construction, multimedia

数据库管理系统外文翻译

附录:英文资料及翻译 英文原文: DATA BASE MANAGEMENT SYSTEMS You know that a data is a collection of logically related data elements that may be structured in various ways to meet the multiple processing and retrieval needs of organizations and individuals. there’s nothing new about data bases-early ones were chiseled in st-one, penned on scrolls ,and written on index cards. but mow data bases are commonly recorded on magnetizeable media, and computer programs are required to perform the necessary storage ad retrieval operations. The system software package that handles the difficult tasks associated with creating , accessing ,and maintaining data base records is in a DBMS package establish an interface between the data base itself and the users of the data base . ( these users may be applications programmers ,managers and others with information needs , and various OS programs.) A DBMS can organize, process, and present selected data elements from the data base .this capability enables decision makers to search . probe ,and query data base contents in order to extract answers to nonrecurring and unplanned questions that aren’t available in regular reports . these questions might initially be vague and /or poorly defined ,but people can “browse” through the data base until they have the needed information . in short, the DBMS will “manage ”the stored data items and assemble the needed items from the common data base in response to the queries of those who aren’t programmers. In a file-oriented system ,users needing special information may communicate their needs to a programmer , who ,when time permits, will information. The availability of a DBMS ,however, offers users a much faster alternative communications path (see figure). Sequential, direct, and other file processing approaches are used to organize and structure data in single files .but a DBMS is able to integrate data elements from several files to answer specific user inquiries fir information. This means that the DBMS is able to integrate data elements from

数据库管理外文翻译

数据库管理 数据库(有时拼成Database)也称为电子数据库,是指由计算机特别组织的用下快速查找和检索的任意的数据或信息集合。数据库与其它数据处理操作协同工作,其结构要有助于数据的存储、检索、修改和删除。数据库可存储在磁盘或磁带、光盘或某些辅助存储设备上。 一个数据库由一个文件或文件集合组成。这些文件中的信息可分解成一个个记录,每个记录有一个或多个域。域是数据库存储的基本单位,每个域一般含有由数据库描述的属于实体的一个方面或一个特性的信息。用户使用键盘和各种排序命令,能够快速查找、重排、分组并在查找的许多记录中选择相应的域,建立特定集上的报表。 数据库记录和文件的组织必须确保能对信息进行检索。早期的系统是顺序组织的(如:字母顺序、数字顺序或时间顺序);直接访问存储设备的研制成功使得通过索引随机访问数据成为可能。用户检索数据库信息的主要方法是query(查询)。通常情况下,用户提供一个字符串,计算机在数据库中寻找相应的字符序列,并且给出字符串在何处出现。比如,用户必须能在任意给定时间快速处理内部数据。而且,大型企业和其它组织倾向于建立许多独立的文件,其中包含相互关联的甚至重叠的数据,这些数据、处理活动经常需要和其它文件的数据相连。为满足这些要求,开发邮各种不同类型的数据库管理系统,如:非结构化的数据库、层次型数据库、网络型数据库、关系型数据库、面向对象型数据库。 在非结构化的数据库中,按照实体的一个简单列表组织记录;很多个人计算机的简易数据库是非结构的。层次型数据库按树型组织记录,每一层的记录分解成更小的属性集。层次型数据库在不同层的记录集之间提供一个单一链接。与此不同,网络型数据库在不同记录集之间提供多个链接,这是通过设置指向其它记录集的链或指针来实现的。网络型数据库的速度及多样性使其在企业中得到广泛应用。当文件或记录间的关系不能用链表达时,使用关系型数据库。一个表或一个“关系”,就是一个简单的非结构列表。多个关系可通过数学关系提供所需信息。面向对象的数据库存储并处理更复杂的称为对象的数据结构,可组织成有层次的类,其中的每个类可以继承层次链中更高一级类的特性,这种数据库结构最灵活,最具适应性。 很多数据库包含自然语言文本信息,可由个人在家中使用。小型及稍大的数据库在商业领域中占有越来越重要的地位。典型的商业应用包括航班预订、产品管理、医院的医疗记录以及保险公司的合法记录。最大型的数据库通常用天政府部门、企业、大专院校等。这些数据库存有诸如摘要、报表、成文的法规、通讯录、报纸、杂志、百科全书、各式目录等资料。索引数据库包含参考书目或用于

数据库中英文对照外文翻译文献

中英文对照外文翻译 Database Management Systems A database (sometimes spelled data base) is also called an electronic database , referring to any collection of data, or information, that is specially organized for rapid search and retrieval by a computer. Databases are structured to facilitate the storage, retrieval , modification, and deletion of data in conjunction with various data-processing operations .Databases can be stored on magnetic disk or tape, optical disk, or some other secondary storage device. A database consists of a file or a set of files. The information in these files may be broken down into records, each of which consists of one or more fields. Fields are the basic units of data storage , and each field typically contains information pertaining to one aspect or attribute of the entity described by the database . Using keywords and various sorting commands, users can rapidly search , rearrange, group, and select the fields in many records to retrieve or create reports on particular aggregate of data. Complex data relationships and linkages may be found in all but the simplest databases .The system software package that handles the difficult tasks associated with creating ,accessing, and maintaining database records is called a database management system(DBMS).The programs in a DBMS package establish an interface between the database itself and the users of the database.. (These users may be applications programmers, managers and others with information needs, and various OS programs.) A DBMS can organize, process, and present selected data elements form the database. This capability enables decision makers to search, probe, and query database contents in order to extract answers to nonrecurring and unplanned questions that aren’t available in regular reports. These questions might initially be vague and/or poorly defined ,but people can “browse” through the database until they have the needed information. In short, the DBMS will “manage” the stored data items and assemble the needed items from the common database in response to the queries of those who aren’t programmers. A database management system (DBMS) is composed of three major parts:(1)a storage subsystem

相关文档
最新文档