Masami Hagiya
University of Tokyo
There have been developed many programs for managing interface between database systems and their users. In this work, we developed a user-interface for SYBASE, one of the most popular relational database systems at this moment. The user-interface is implemented on top of the general-purpose text-editor GNU Emacs, which is the de facto standard text-editor on workstations. Following are some advantages of using Emacs.
In order to solve the above problem, we took the following approach. A database user prepares for each retrieval condition a file called a retrieval file for retrieving a database. The result of retrieving the database by the condition is directly written on the retrieval file. The result is then displayed by a schema file, which is prepared for each table in the database.
The part for the retrieval result is empty before the database is retrieved.
Each record in the retrieval result should fit on one line and should contain the key field. This means that in the select statement, one should specify the key field and possibly some more short fields.
A schema file specifies a format for displaying or editing a table (or a view) in a relational database. By preparing a schema file for each table in the database, a user can enjoy a display-oriented database-interface on Emacs. Following is an example of a record displayed on a window.
id: 888-888-888 Name: Masami Hagiya Phone: 03(3812)2111 Address: Ohara 1-8-11, Setagaya-ku Tokyo Japan 156 Contract: 0In order to display a record of the authors table of the pubs database in the above format, a user should prepare the following schema file.
id: %(au_id varchar) Name: %(au_fname varchar) %(au_lname varchar) Phone: %(phone varchar) Address: %(address varchar) %(city varchar) %(state varchar) %(zip varchar) Contract: %(contract bit)Strings in the schema file are literally displayed on a window unless they take the following form.
In each item of the above form, the name and the type of a field are specified. The actual value of the specified field in each record is displayed at the position of the item. In the above example, au_id is a field name and varchar is a type.
The Emacs-interface can then select the appropriate schema file when it displays a record in a table.
We successfully developed a user-interface for the relational database SYBASE on top of the text-editor Emacs, taking the approach of the Emacs-interfaces for electric mail and news. In our user-interface, the correspondence between a retrieval condition and its result is naturally maintained because they are saved on the same file. By schema files, we also provide the display-oriented database-interface on Emacs.