• 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
    Krengeltech

    When it comes to consuming web APIs on your IBM i, your options often boil down to one of two things:

    First, you end up having to rely on a variety of open source and non-RPG solutions. This adds developer complexity, taking away time that could have been better spent invested in other projects. Of course, open source software is free, but generally comes at the cost of no professional support, which adds an element of risk in your production environment. RXS is completely professionally supported, and is complemented by a staff of trained IBM i developers who can address your nuanced development challenges, head on.

    Second, if you choose not to pursue an open-source solution, you’re often left having to shake up your current program architecture with proprietary software, external dependencies, and partial RPG implementations – many of which are sub-par compared to RPG-XML Suite’s wide range of features. RXS aims to simplify the efforts of developers with tools like code generators, useful commands, and subprocedures written in 100% RPG – no Java. Because they are entirely RPG, the RXS subprocedures are easy to add to new or existing ILE programs and architecture, helping to cut your development time. RPG-XML Suite offers powerful capabilities in an accessible, easy-to-implement format.

    With RPG-XML Suite, you can accomplish a variety of complex tasks, such as:

    • Calling REST and SOAP web services from your IBM i
    • Offering APIs from your IBM i
    • Creating JSON & XML
    • Parsing JSON & XML
    • Text manipulation, Base64 encoding/decoding, CCSID handling, hashing and encryption functions, and more.

    To try RXS for yourself, we recommend a free proof of concept, which not only gives you access to all of RPG-XML Suite’s subprocedures and utilities but also includes a tailor-made software demonstration that can be used as a starting point for your future API implementations.

    For a free proof of concept, contact us at sales@krengeltech.com, or visit our website for more information.

    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

  • IBM i 7.3 TR12: The Non-TR Tech Refresh
  • IBM i Integration Elevates Operational Query and Analytics
  • Simplified IBM i Stack Bundling Ahead Of Subscription Pricing
  • More Price Hikes From IBM, Now For High End Storage
  • Big Blue Readies Power10 And IBM i 7.5 Training for Partners
  • IBM Delivers More Out-of-the-Box Security with IBM i 7.5
  • Groundhog Day For Malware
  • IBM i Community Reacts to IBM i 7.5
  • Four Hundred Monitor, May 11
  • IBM i PTF Guide, Volume 24, Number 19

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 © 2022 IT Jungle

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.