• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Displaying Multiple Results Sets in Run SQL Scripts

    October 15, 2008 Skip Marchesani

    The SQL Script Center, which is part of the System i Navigator Database function, allows the user to execute a script that contains single or multiple SQL statements. If the script contains multiple SQL statements, the user has the option of executing a single SQL statement, the entire script (starting with first statement in the script and ending with the last statement in the script) or two or more consecutive SQL statements as a subset of the script.

    The results from executing an SQL statement are shown in the lower portion of the Run SQL Scripts window called the Output pane. There always will be a Messages tab where a completion message is displayed for each SQL statement or CL command that is executed as shown in Figure 1.

    Figure 1

    And when a SELECT statement is executed, assuming you are using the defaults for Options in the toolbar, there will be a Results tab that displays the results set for the SELECT statement as shown in Figure 2.

    Figure 2

    The issue that many users have with the Results tab is that it only displays the Results set for that last SELECT statement executed, and many times you want to see the Results set for a series of SELECT statements so they can be compared. This is very easy to accomplish. Just click on Options in the toolbar, then click on Display Results in a Separate Window to select it. Also, make sure that Smart Statement Selection is selected (normally it would be selected since it’s the default) as shown in Figure 3.

    Figure 3

    The next question is how to execute a series of SELECT statements at the same time. There are a couple of alternatives. You can highlight each SELECT statement to be executed and then click on Run Selected (far right hourglass) in the toolbar, as shown in Figure 4, and the Results set for each will be displayed in a separate window.

    Figure 4

    The windows for each result set are displayed directly on top of each other so you have to manually reposition and possibly resize all displayed windows to be able to see each one and make visual comparisons as shown in Figure 5. The downside of Display Results in a Separate Window is that each open window must be manually closed to remove it from your desktop. However I feel that this is a minor inconvenience compared to the benefit of having multiple results sets displayed at the same time.

    Figure 5

    There is another alternative for executing an SQL statement in the Options drop-down menu on the toolbar, which eliminates selecting the statement and then selecting the execution option. As shown in Figure 6, select Run Statement on Double-Click from the Options drop-down menu, and you can execute any single SQL statement by placing the cursor on the statement and double clicking it with your mouse. This allows you to easily execute a series of SQL statements–one at a time–and if it’s a SELECT statement, have each Result set displayed in a separate window, without having to keep moving the cursor between the statements and the toolbar.

    Figure 6

    Skip Marchesani retired from IBM after 30 years and is now a consultant with Custom Systems Corporation. He is also a founding partner of System i Developer and the RPG & DB2 Summit. Skip spent much of his IBM career working with the Rochester Development Lab on projects for S/38 and AS/400 and was involved with the development of the AS/400. He was part of the team that taught early AS/400 education to customers and IBM lab sites worldwide. Skip is recognized as an industry expert on DB2 for i and the author of the book “DB2/400: The New AS/400 Database.” He specializes in providing customized education for any area of the System i, iSeries, and AS/400; does database design and design reviews; and performs general System i, iSeries, and AS/400 consulting for interested clients. He has been a speaker for user groups, technical conferences, and System i, iSeries, and AS/400 audiences around the world. He is an award-winning COMMON speaker and has received its Distinguished Service Award. Send your questions or comments for Skip to Ted Holt via the IT Jungle Contact page.



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    ARCAD Software:  October 22 Webcast! WDSc & RDi: Debugging with Don Yantzi
    BCD:  Presto instantly Web enables 5250 Green Screen Apps with NO RPG, Cobol or DDS code changes
    Vision Solutions:  A $20 gas card for completing a short i5/OS DR survey

    IT Jungle Store Top Book Picks

    Easy Steps to Internet Programming for AS/400, iSeries, and System i: List Price, $49.95
    Getting Started with PHP for i5/OS: List Price, $59.95
    The System i RPG & RPG IV Tutorial and Lab Exercises: List Price, $59.95
    The System i Pocket RPG & RPG IV Guide: List Price, $69.95
    The iSeries Pocket Database Guide: List Price, $59.00
    The iSeries Pocket Developers' Guide: List Price, $59.00
    The iSeries Pocket SQL Guide: List Price, $59.00
    The iSeries Pocket Query Guide: List Price, $49.00
    The iSeries Pocket WebFacing Primer: List Price, $39.00
    Migrating to WebSphere Express for iSeries: List Price, $49.00
    iSeries Express Web Implementer's Guide: List Price, $59.00
    Getting Started with WebSphere Development Studio for iSeries: List Price, $79.95
    Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
    Getting Started with WebSphere Express for iSeries: List Price, $49.00
    WebFacing Application Design and Development Guide: List Price, $55.00
    Can the AS/400 Survive IBM?: List Price, $49.00
    The All-Everything Machine: List Price, $29.95
    Chip Wars: List Price, $29.95

    Aviva Updates 5250 Emulator for Windows Vista Some Servers Take a Dive in IBM’s Third Quarter

    Leave a Reply Cancel reply

Volume 8, Number 35 -- October 15, 2008
THIS ISSUE SPONSORED BY:

Profound Logic Software
Group8 Security
Aldon

Table of Contents

  • Displaying Multiple Results Sets in Run SQL Scripts
  • A Practical Way to Add Exports to a Service Program
  • Admin Alert: Preventing Multiple IPs from Stopping Internet Traffic

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • The Power11 Transistor Count Discrepancies Explained – Sort Of
  • Is Your IBM i HA/DR Actually Tested – Or Just Installed?
  • Big Blue Delivers IBM i Customer Requests In ACS Update
  • New DbToo SDK Hooks RPG And Db2 For i To External Services
  • IBM i PTF Guide, Volume 27, Number 33
  • Tool Aims To Streamline Git Integration For Old School IBM i Devs
  • IBM To Add Full System Replication And FlashCopy To PowerHA
  • Guru: Decoding Base64 ASCII
  • The Price Tweaking Continues For Power Systems
  • IBM i PTF Guide, Volume 27, Numbers 31 And 32

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle