Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!cernvax!ethz!marti From: marti@ethz.UUCP (Robert Marti) Newsgroups: comp.databases Subject: Call Interfaces to RDBMSs Message-ID: <168@bernina.UUCP> Date: Tue, 4-Aug-87 06:33:18 EDT Article-I.D.: bernina.168 Posted: Tue Aug 4 06:33:18 1987 Date-Received: Sat, 8-Aug-87 08:56:51 EDT Organization: ETH Zuerich, Switzerland Lines: 50 The prevalent approach to offer set-oriented access to a relational database from an application written in a langauge such as C seems to be pre-compilation. For example, embedded SQL uses database statements bracketed by EXEC SQL and END-EXEC keywords while embedded QUEL uses the ## marker on the beginning of each line. The pre- processor strips these statements and replaces them by procedure calls to the DBMS. There are two drawbacks to such a solution: The first and minor one is that such constructs look unpleasant in the source. The second and major drawback is that a pre-processor has to written for each new host language for which database access has to be supported. This may be OK for vendors who can easily tailor their existing pre-processor to a new language, but for customers without access to source this is a major pain (you know where :-) Since we would like to use Modula-2 to access relational databases -- Modula-2 is the language our programmers (students) know best -- we'd much rather have an interface in the form of a library of procedures. An example of such an interface is provided by Sun's enhanced version of UNIFY which supports query_open, query_next and query_close statements as shown below: char[30] emp_name; int emp_sal; cursor = query_open("select name, salary from emp"); while (query_next(cursor, "%s %d", emp_name, &emp_sal) == DB_SUCCESS) { /* process the retrieved stuff */ } query_close(cursor); (Note that the "%s %d" string in query_next is a format string as used in the well-known scanf, printf etc. functions.) Unfortunately, UNIFY is weak in other areas, namely in its support for transactions and views. Therefore my questions: Are there any other UNIX DBMS products out there which support relational queries via a call interface as opposed to a pre-processor? Do INGRES or Oracle explain in their manuals how to interface to their database system without using the pre-processor? Thanks in advance for any explanations on the subject. Bob -- Robert Marti Phone: +41 1 256 52 36 Institut fur Informatik ETH Zentrum/SOT CSNET/ARPA: marti%ifi.ethz.ch@relay.cs.net CH-8092 Zurich, Switzerland UUCP: ...seismo!mcvax!ethz!marti