fhg
Volume 10, Number 3 -- January 20, 2010

Run SQL Scripts: Use Temporary JDBC Settings

Published: January 20, 2010

by Skip Marchesani

I consider myself to be a power user of Run SQL Scripts and use them for a variety of purposes, including ad hoc queries to do data analysis. Run SQL Scripts can be configured for your personal preferences (SQL default schema or current library, schema or library list, SQL or system naming convention, and other parameters) by clicking on Connection in the toolbar and then JDBC properties. Once you select your personal preferences and click the Connect button on the bottom of the JDBC Setup panel, your preferences are saved and become the default each time you invoke Run SQL Scripts.

Often when I run ad hoc queries, these preferences need to be changed to suit the query, and one of my frustrations with Run SQL Scripts is the inability to temporarily change the JDBC settings. Changing the settings was not the issue. The problem was that the change was permanent and more times than I like to remember, I would forget to make the change back to my default settings and then wonder why the execution of my SQL script would fail the next time I used Run SQL Scripts.

IBM solved the problem by adding the capability to use temporary settings in V6R1 of Navigator and Run SQL Scripts. A temporary change can be made by clicking on Connections in the toolbar and then Use Temporary JDBC Settings in the dropdown menu. (Also note that in V6R1 you can view the current JDBC settings by clicking on Show JDBC Properties in the dropdown menu; however, I find the format of the resulting display difficult to read and I don't use it.)

To see how Use Temporary JDBC Settings works, let's run the ad hoc query against the table called CUSTTEST as shown in Figure 1.


Figure 1.

Note that the attempt to run the query failed, returning an SQL State code of 42704, which says that the table CUSTTEST could not be found in the schemas or libraries that were specified in my default JDBC settings for Run SQL Scripts.

To see the SQL default schema (current library) and the schema list (library list), click on Connection and then JDBC Settings in the resulting drop-down menu. The JDBC Setup panel is displayed as shown in Figure 2. We can see that the SQL default schema is SKIPSQL with no schema list specified, so the current library is SKIPSQL and default user library list for the job is in effect.


Figure 2.

Suddenly the light bulb goes on in my head because I remember that the table called CUSTTEST is in the schema or library called SQLWRK and not SKIPSQL. Rather than change the JDBC Setup permanently, let's make a temporary change that will easily revert back to the default settings.

To make temporary changes to the default JDBC settings, click on Connection in the toolbar and then Use Temporary JDBC Settings in the resulting drop-down menu as shown in Figure 1. The temporary JDBC Setup panel will then be displayed as shown in Figure 3.


Figure 3.

Change the name of the SQL default schema to SQLWRK and click the Connect button on the panel. RUN SQL Scripts will reconnect to the system with SQLWRK as the temporary SQL default schema, and the Run SQL Scripts Panel will be redisplayed.

Now when the query is run against CUSTTEST a second time, it executes successfully as shown in Figure 4.


Figure 4.

When you exit Run SQL Scripts you will be prompted to either discard the temporary JDBC settings and revert to the saved default settings, or save the temporary settings as the new default for Run SQL Scripts as shown in Figure 5.


Figure 5.

The ability to set temporary JDBC settings in V6R1 of Navigator and Run SQL Scripts give Run SQL Scripts more flexibility and makes it easier to use. And, it eliminates an issue that I found very frustrating.


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.


RELATED STORIES

Prompting CL in Run SQL Scripts

V6R1 Run SQL Scripts: Print and Save Result Sets

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

Configuring Run SQL Scripts for Ad Hoc Queries

Changing the Library List for Run SQL Scripts

Visual Explain for Run SQL Scripts

Displaying Multiple Results Sets in Run SQL Scripts

V6R1 Enhancements for Run SQL Scripts



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


Sponsored By
SEQUEL SOFTWARE

SEQUEL ViewPoint®--Data Access & Analysis
for Power Systems™ Servers

                                               · Easy to use by IT and end users
                                               · Automated data access and display
                                               · Complete BI package: reports, tables,key
                                                  performance indicators, and dashboards
                                               · IBM i-centric for real-time data analysis
                                               · Expert support and training
                                               · Secure data access
                                               · Green screen, Web, browser

SEQUEL--Fast, efficient & cost-effective data analysis

Click here for a FREE Information Kit!


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

PowerTech:  Strengthen your security. Get a FREE Compliance Assessment today
Profound Logic Software:  FREE Webinar, Jan 27. Learn how to integrate your i apps and save big
COMMON:  Join us at the annual 2010 conference, May 3 - 6, in Orlando, Florida


 

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
The System iWant, 2010 Edition: Big Boxes

Analysts Bid Good Riddance to IT Recession

Microsoft, HP Talk Up Frontline Integrated Systems

Mad Dog 21/21: Orwell's Flat

Lawson Bets More Heavily on Healthcare

Four Hundred Stuff
Unitrends Delivers Backup Simplicity with D2D Appliances

Rainmaker's Profit Optimization Software Good as Gold to Casinos

Pat Townsend Updates MFT Offering for i/OS

Linoma Bolsters GoAnywhere MFT Tool with New Features

FIS Reports Solid 2009 Sales of i/OS Core Banking System

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

System i PTF Guide
January 16, 2010: Volume 12, Number 03

January 9, 2010: Volume 12, Number 02

January 2, 2010: Volume 12, Number 01

December 26, 2009: Volume 11, Number 52

December 19, 2009: Volume 11, Number 51

December 12, 2009: Volume 11, Number 50

TPM at The Register
Intel linked with HPC boost buy

Intel rides Nehalem to heavenly profits

Big Blue rides Schooner to MySQL boost

AMD's GlobalFoundries consumes Chartered Semi rival

Nvidia gets biological with life sciences nerds

VMware hypervisors on the Go

HP, Microsoft form $250m IT tag team

Sun marries Hadoop to Grid Engine

Cisco taps Avnet to peddle 'California' servers

Tech downturn is history, says Forrester

Terracotta polishes Quartz job scheduler

Sun, Fujitsu juice entry Sparc box

THIS ISSUE SPONSORED BY:

SEQUEL Software
WorksRight Software
COMMON


Printer Friendly Version


TABLE OF CONTENTS
Run SQL Scripts: Use Temporary JDBC Settings

Can a Function Return More Than One Value?

Admin Alert: Erasing i5/OS Disk for Fun and Compliance

Four Hundred Guru

BACK ISSUES




 
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-2010 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement