Download SQL/MX Quick Start - Hewlett Packard Enterprise Support Center
Transcript
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 -------186 212 244 ... Part Description ---------------186 MegaByte Disk PC SILVER, 20 MB PC GOLD, 30 MB ... Price -----------186186.86 2500.00 3000.00 ... HP NonStop SQL/MX Quick Start—523724-002 2 -1 Qty/Avail ---------186 3525 4426 ...