SQL/MX Quick Start (G06.24+, H06.03+)

HP NonStop SQL/MX Quick Start523724-002
2-1
2
Selecting Information From a Table
This section provides information about how to select specific rows and columns and
how to use the INVOKE command.
Working With SQL/MP Tables
SQL/MX supports DML operations on SQL/MP tables as well as SQL/MX tables. At the
beginning of each new MXCI session, specify if you will use three-part logical names or
Guardian physical file names to refer to SQL/MP tables. (You must use logical names
to refer to SQL/MX tables.)
To use logical names, at the MXCI prompt, type:
SET NAMETYPE ANSI;
To use Guardian physical file names, at the MXCI prompt, type:
SET NAMETYPE NSK;
The NAMETYPE attribute value you specify with SET NAMETYPE remains in effect until
the end of the session or until you execute another SET NAMETYPE statement. You
can use logical names if you have created aliases using the CREATE SQLMP ALIAS
statement.
For more information about the SET NAMETYPE command or the CREATE SQLMP
ALIAS statement, see the SQL/MX Reference Manual.
Selecting All the Data From a Table
The simplest operation you can perform is to retrieve all the data from a single table.
Typically, it is not practical to display all rows in a table. However, the number of rows
in the sample database is small.
Example
To retrieve information from tables, use the SELECT statement. Enter this SELECT
statement to display all rows and columns in the PARTS table:
SELECT * FROM PARTS;
Some selected rows are:
Part/Num Part Description Price Qty/Avail
-------- ---------------- ------------ ----------
186 186 MegaByte Disk 186186.86 186
212 PC SILVER, 20 MB 2500.00 3525
244 PC GOLD, 30 MB 3000.00 4426
... ... ... ...