[USflag] The American Programmer [USflag]
Home Programming Books for Computer Professionals Privacy Terms
           Home   > Programming   > Using QMF to Execute Your SQL

Using QMF to Execute Your SQL

You want to run some structured query language to access data that is on DB2. Your company has the IBM product QMF installed.


Get into QMF. Each company has its own way of getting into QMF. Find out how your company wants you to enter QMF.

______________________________________________________________________________ 
 IBM*                                                                           
 * Trademark of International Business Machines                                 
 ______________________________________________________________________________ 
                                                                                
  QMF HOME PANEL                                                               
  Version 3 Release 0.0  Z                   ******     **    **      ********* 
                                           **     **   ***   ***     **         
  Query                                   **     **   ****  ****    *******     
  Management                             **     **   ** ** ** **   **           
  Facility                              **   * **   **  ****  **  **            
                                         ******    **   **    ** **             
________________________________________ 
                                                                                
 Type command on command line or use PF keys. For help, press PF1 or type HELP. 
 ______________________________________________________________________________ 
 1=Help        2=List        3=End         4=Show       5=Chart        6=Query  
 7=Retrieve    8=Edit Table  9=Form       10=Proc      11=Profile     12=Report 
                                                          

Press PF6 to get into the query panel


SQL QUERY LINE 1 *** END *** 1=Help 2=Run 3=End 4=Print 5=Chart 6=Draw 7=Backward 8=Forward 9=Form 10=Insert 11=Delete 12=Report QUERY is displayed. COMMAND SCROLL Tab twice Type in the SQL query
SQL QUERY LINE 1 select * from q.staff *** END *** 1=Help 2=Run 3=End 4=Print 5=Chart 6=Draw 7=Backward 8=Forward 9=Form 10=Insert 11=Delete 12=Report OK, QUERY is displayed. COMMAND SCROLL ===> PAGE Press F2 to execute the SQL query
REPORT LINE 1 POS 1 79 ID NAME DEPT JOB YEARS SALARY COMM ------ --------- ------ ----- ------ ---------- ---------- 10 SANDERS 20 MGR 7 18357.50 - 20 PERNAL 20 SALES 8 18171.25 612.45 30 MARENGHI 38 MGR 5 17506.75 - 40 O'BRIEN 38 SALES 6 18006.00 846.55 50 HANES 15 MGR 10 20659.80 - 60 QUIGLEY 38 SALES - 16808.30 650.25 70 ROTHMAN 15 SALES 7 16502.83 1152.00 80 JAMES 20 CLERK - 13504.60 128.20 90 KOONITZ 42 SALES 6 18001.75 1386.70 100 PLOTZ 42 MGR 7 18352.80 - 110 NGAN 15 CLERK 5 12508.20 206.60 120 NAUGHTON 38 CLERK - 12954.75 180.00 130 YAMAGUCHI 42 CLERK 6 10505.90 75.60 140 FRAYE 51 MGR 6 21150.00 - 1=Help 2= 3=End 4=Print 5=Chart 6=Query 7=Backward 8=Forward 9=Form 10=Left 11=Right 12= OK, this is the REPORT from your RUN command. COMMAND SCROLL ===> PAGE Press PF6 to get back into the query panel
Useful things you can do with QMF Giving yourself a copy of a table that you can INSERT/UPDATE/DELETE (Not all companies will let you do this)
SQL QUERY LINE 1 *** END *** 1=Help 2=Run 3=End 4=Print 5=Chart 6=Draw 7=Backward 8=Forward 9=Form 10=Insert 11=Delete 12=Report OK, QUERY is displayed. COMMAND SCROLL ===> PAGE Type on the command line: (one line at a time, pressing ENTER after each line) RESET QUERY DISPLAY table-name for example: STAFF SAVE DATA AS table-name qualified with your Userid for example: Userid.STAFF You now have a table that you own. You can practice modifying it without affecting anyone else.
[Books Computer]

Home Programming Books for Computer Professionals Privacy Terms Contact |
Site Map and Site Search Programming Manuals and Tutorials The REXX Files Top of Page |

[link page]