How does the program communication take place in a dbms model?
The program and the DBMS communicate in terms of six types of information:
The action information
refers to the verbs which the programmer uses to tell the DBMS what
to do. Action statements include two types: retrieval statements which
do not change the contents of the database, and modification statements
which do change the content of the database.
- Locate data in
the database to determine its existence or to prepare for further processing.
This often results in data begin brought into the DBMS buffer, but dose
not make it available to the user program.
Object Data :
The second type of information to be communicated to the DBMS conveys the names of elements in the database structure which are to be the object of the action part of the statement. In general, the programmer will name files, groups and data items. To the extent that names are not unique within a database, a programmer will have to provide additional qualifying names to resolve any possible ambiguity of reference. Where only one file can be addressed at a time, the file name may be determined globally or by default. Similarly, where the system always retrieves or writes a complete entry of a file, it is not necessary to name any groups or data items to identity selected portions of an entry.
Selection Criteria :
A file consists of many records of a single record type that is, conforming to a single definition. In any database, there will generally be many instances of the named object data. The selection criteria information identifies which instance of the object data are to be selected. The basis of the selection criteria may be either position or content.
Content based selection In content selection, the criteria is expressed in terms of the contents of the named object data instances. This may range from a simple criterion, such as the equality of a pre-declared key data item with a search argument value, to a full Boolean expression. Both programming users and non programming users must be able to identity selected instances of repeating data structures. The normal and most natural way to identify instances of a repeating data structure is on the basis of criteria applied to the content of that data structure and expressed in the form of a Boolean expression.
Position based selection Position selection depends upon an existing or assumed sequence on the instances of that object data. Both the programmer and the system must have a common understanding regarding the sequence of records in a file. The position criteria are expressed using such phrases as first, last, nth from the first, or nth from the last. Additional positional criteria may be based upon the concept of currency. Once the system has successfully executed a database manipulation language statement which names object data and locates or selects particular instances of the object data, there will exist, in effect, if not in fact, a pointer into the database. The pointer remembers the most recent place in the database that system looked or acted, hence, the concept of currency and currency pointers.
User schema Definition and User Program Buffer :
Every program which references the database must have one or more user schemas associated with it. The user schema is a definition of a data structure as the programming user sees it when writing a program, and therefore, as the program expects to see it during execution. The user schema provides the definition and the structural context for the data names as the object of the action and for the data named in the selection criteria. The user schema is actually made up of three parts, -a logical data definition, a physical storage or a buffer definition, and a mapping.
The logical data
structure definition provides the names, other defining attributes and
structure of the data as seen by the program. Since actual data will
be delivered to the program during execution, the logical definition
must ultimately have a physical representation. The buffers associated
with the user schemas can be set up at compile time or during execution
when the program first signals its intent to begin processing a file
or portion of the database.
Error and Exception
Copyright - © 2005 - 2017 - www.management-hub.com