NonStop Systems Introduction for H-Series RVUs

The Relational Database Management System
NonStop Systems Introduction for H-Series RVUs540083-001
4-8
Programming Interface
Figure 4-4 shows the relationship between the end user and the MXCI interface. The
user submits a query to MXCI and receives output data from MXCI at the display
screen or printer.
If the query made by the user in Figure 4-4 is a simple SELECT statement, MXCI
accesses the specified table, constructs a temporary table containing the data retrieved
by the query, and sends the data to the standard output file.
If the query includes report formatting commands in addition to the SELECT statement,
MXCI constructs a formatted report with a title, column headings, page numbers, and
any other formatting the user specified using the report mode. MXCI sends this report
to the standard output file.
The following commands enable the user to produce a formatted report showing the
name and number of all those employees in the EMPLOYEE table who are in
department 4000. The report includes a title and a special heading for each column.
>> mode report;
SELECT fname, lname, empnum
FROM employee
WHERE deptnum = 4000;
REPORT TITLE "Employee List, Dept 4000";
DETAIL fname HEADING "Employee Name",
lname NOHEAD,
empnum HEADING "Number";
S>LIST ALL;
Programming Interface
This subsection presents a brief overview of the SQL/MX programming interfaces. For
detailed information about these interfaces, see the SQL/MX Programming Manual for
C and COBOL and the JDBC Driver for SQL/MX Programmer’s Reference.
The SQL/MX programming interface enables developers to embed their tested SQL
statements within source code written in languages such as C, C++, COBOL, and
Java. To compile a C, C++, or COBOL source program containing embedded SQL
statements, you run both the host language compiler and the SQL/MX compiler.
Figure 4-4. SQL/MX Conversational Interface (MXCI)
MXCI
VST047.vsd