fhg
Volume 9, Number 20 -- June 17, 2009

V6R1 Run SQL Scripts: Saving Scripts to a System i Source File

Published: June 17, 2009

by 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


Sponsored By
PRODATA COMPUTER SERVICES

Simplify your iT!

DBU - super easy to use. The leading data access tool on the market.

DBU RDB - does the work for you. Analyze data on all your servers.
MySQL, Microsoft SQL Server, Oracle, DB2 databases and others.

RDB Connect - programmatic access to remote data! Full SQL access to
remote databases from all System i high-level languages.

Download your free trials NOW.
Order today and SAVE $$$!
www.prodatacomputer.com
800.228.6318


Senior Technical Editor: Ted Holt
Technical Editor: Joe Hertvik
Contributing Technical Editors: Erwin Earley, Brian Kelly, Michael Sansoterra
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

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


 
The Four Hundred
Infrastructure Business Monopoly

Power6+ Blade Performance: IBM's Competitive Analysis

PowerVM Hypervisor Gets Active Memory Sharing

Mad Dog 21/21: Playing For Keeps in Peoria

CIOs Cut IT Spending 5 Percent in Q1, Gartner Says

Four Hundred Stuff
Crossroads Pushing VTL Solution to System i Customers

IBI Updates WebFOCUS BI Platform

Micro Focus Consolidates Legacy Code Modernization Solutions

xTuple Opens an Online Store for ERP Extensions

QlikTech Continues BI Industry Leadership with QlikView 9

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

System i PTF Guide
June 13, 2009: Volume 11, Number 24

June 6, 2009: Volume 11, Number 23

May 30, 2009: Volume 11, Number 22

May 23, 2009: Volume 11, Number 21

May 16, 2009: Volume 11, Number 20

May 9, 2009: Volume 11, Number 19

TPM at The Register
EMC pushes services for virtual servers

HP servers still half-cold to Ubuntu

IBM churns up CloudBurst clouds

Cisco California pricing revealed

Sun's top brass get golden parachutes...

Voltaire punts monster 10 GE switch

Web servers get 'leccy bill

AMD cooking up low-power, twin server

OpenSolaris ported to ARM chips

AMD claws cash back from Intel

HP serves up cookie sheet servers

Germans fire up 200 teraflop Juropa2 super

Apple tight-leashes 'Snow Leopard' Server

Red Hat goes one louder with Fedora 11

THIS ISSUE SPONSORED BY:

ProData Computer Services
WorksRight Software
CNX


Printer Friendly Version


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

Four Hundred Guru

BACK ISSUES

From the IT Jungle Forums
PHP CLI Call

Perl, PHP, and/or ZendCore

batch printing PDF files from RPG program

Using db2_connect in PHP on iSeries

How to return value from CL program?

ADO.NET/IBM.Data.DB2.iSeries/ iDB2Connection

Order by alias names




 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2009 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement