QMF notes


Single Table Queries

SELECT *
FROM table-name
WHERE ((column_name_char='X'
AND column_name_num < 1)
OR (column_name_dt_tm >
'2001-01-31-11:20:55:01'
AND column_name_char < > 'X'
ORDER BY column_name ASC/DESC

The * indicates all columns, a list of cols may also be used. Table names must typically be fully qualified.





The default is ASC.

Multiple table Queries

SELECT *
FROM table-name1 tb1,
table-name2 tb2
WHERE tb1.column_name1 =
tb2.colunm_name1
AND tb1.colunm_name2 =
tb2.column_name2 column_name_num < 1)
AND tb1.column_name1 LIKE 'abc%'

The alias (tb1 and tb2) saves typing on fully qualified names. Column names must be qualified if more column name duplicates exist accross tables.

SQL updates

UPDATE table-name
SET column_name1 = 'abcde"
WHERE column_name2 = 'lmnop'
You cannot update through a multiple table join. You may have to do a multi-talbe select to determine how to uniquely identify a revcord for updating, then write your update statement.

SQL Deletes

DELETE
FROM table-name
SET column_name1 = 'abcde"

Write a select query first to test your where clause before deleting.

QMF Notes

Query - The SQO statements used to retrieve information from the DB@ database. It is maintained through the Query Panel (accessible by PF6 from most QMF panels).

Form - The desired format for a report which is applied to the results of a query. Enables you to add headings/footings, change column widths, include/exclude columns, etc. (accessible by PF9 from most QMF panels)


Line commands:

  • LIST QUERIES Available actions:
    • DISPLAY
    • RUN
    • ERASE
  • LIST FORMS
  • RESET QUERY
  • RESET FORM
  • DISPLAY QUERY queryname
  • DISPLAY FORM queryname
  • RUN QUERY queryname
  • EDIT QUERY

  • SAVE QUERY AS queryname
  • SAVE FORM AS formname
  • tablename

  • tablename (TYPE=I)

  • tablename (TYPE=u)

Dispalys the list of saved queries

Displays the SQL for that query
Executes the query
Erases the saved query
Dispays the list of saved forms
Clears the query panel area
Returns the form fields to the default values
Displays the SQL for the specified query
Displays the Form
Executes the specified query
Opens an ISPF edit session containing the SQL currently on the Query screen for easier editting
Save the Query
Save the Form
Press PF6-DRAW. Creates a skeleton Select statement for the named table
Press PF6-DRAW. Creates a skeleton Insert statement for the named table
Press PF6-DRAW. Creates a skeleton Update statement for the named table

Home Links Notebook Tools Map

Pro bono
--------
Marketplace
----US----

<>-<>