• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • V6R1 Run SQL Scripts: Saving Scripts to a System i Source File

    June 17, 2009 Skip Marchesani

    V6R1 brings some nice enhancements to Run SQL Scripts—which is part of the Database function in System i Navigator–that provide more function and make it easier to use. One of these V6R1 enhancements is the ability to save, and retrieve or open an SQL script to/from a System i source file, in addition to saving it to a PC or a stream file.

    The following example shows an SQL script called “custmstr3” that was originally saved as a PC file, and which will now be saved as a System i source file. The first step is to click on File on the left side of the toolbar, and then Save As in the resulting drop down menu as shown in Figure 1.

    Figure 1.

    The resulting Save window provides the option to save the script as a PC file, stream file, or source physical file, with PC file as the default as shown in Figure 2.

    Figure 2.

    Click on the down arrow on the right side of the “Save to” box at the top of the Save window and select Source Physical file, and the parameter data/information boxes required to save to a source file will appear as shown in Figure 3.

    Figure 3.

    Provide the appropriate parameter data to do the save and then click Save on the right side of the Save window to save the SQL script to the designated System i source file.

    The Schema box is used to provide the name of the library where the SQL script will be stored, the Source file box provides the name of the source file, and the Member box provides the source member name for the SQL script. Use the default of “No margin” for “Right margin start”; the Source type should be SQL (for SQL scripts), and text can be optionally provided to document the SQL script as shown in Figure 4.

    Figure 4.

    Note that each of the parameter boxes has a down arrow on the right side. Parameter data can be keyed into each of the boxes, or click on the down arrow to see the options available based on the schemas or libraries in library list for the Run SQL Scripts job.

    Once all the parameter data has been correctly entered, click on the Save button to initiate the save, which will take up to a couple of seconds depending on the speed of your network and activity on the System i. While the save is being done, the input pane of the Run SQL Scripts window will be grayed out. If a member of the same name already exists in the source file, a message will be displayed asking if you want to replace the existing file/member, as shown in Figure 5.

    Figure 5.

    To open an SQL script stored as a System i source file, click on File in the toolbar, and then Open in the resulting drop down widow. The Open widow will be displayed with the default Open parameter of PC file. Change the Open parameter to Source physical file, fill in the required parameters, and click Open as shown in Figure 6.

    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

    New Generation Software:  FREE Query Migration Planning Webinar, June 25, 2 p.m. EST
    Fujitsu PROGRESSION:  RPG to .NET. . . Smart move made simple
    CNX:  Valence is bringing Web 2.0 to System i. Download a FREE 90-day trial

    IT Jungle Store Top Book Picks

    Easy Steps to Internet Programming for AS/400, iSeries, and System i: List Price, $49.95
    The iSeries Express Web Implementer's Guide: List Price, $49.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 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
    Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
    Getting Started with WebSphere Express for iSeries: List Price, $49.00
    Can the AS/400 Survive IBM?: List Price, $49.00
    Chip Wars: List Price, $29.95

    Elementool Keeps Bugs from Falling Through the Cracks AS/400: Still Kicking After 21 Years

    Leave a Reply Cancel reply

Volume 9, Number 20 -- June 17, 2009
THIS ISSUE SPONSORED BY:

ProData Computer Services
WorksRight Software
CNX

Table of Contents

  • V6R1 Run SQL Scripts: Saving Scripts to a System i Source File
  • A Testing Tip
  • Admin Alert: A Simple Save While Active Backup Program

Content archive

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

Recent Posts

  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25
  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24

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