IBM Support

STRSQL sessions - save options

Troubleshooting


Problem

This document describes how to save an interactive IBM i STRSQL session. Your users may ask you if they can 'save' their STRSQL session. This usually comes up when moving from one IBM i box to another

Cause

While the STRSQL session is 'saved' via option 1 (Save and exit session) from the "Exit Interactive SQL" screen, it is not saved in an object that can be restored to another IBM i box.

It is saved to an internal structure that cannot be saved to a savefile or tape.

There are no plans to add that enhancement

Resolving The Problem

When using interactive STRSQL (57xxST1), the sessions can be saved.
The following is an example of the options when exiting STRSQL:

                       Exit Interactive SQL

Type choice, and press the Enter key.

  Option . . . . . . . . .   1 1=Save and exit session
                               2=Exit without saving session
                               3=Resume session
                               4=Save session in source file


Option 1 will save the SQL statements that have been entered into an internal object that will be used by the STRSQL command.

Option 4 will save the SQL statements to a source physical file, and the SQL statements will not be available to the STRSQL command.

When using Option 1, the internal object that is created is not accessible through any other means than STRSQL. This is the design of the product.

Note: Scratch installations or a save from one system and restoring to another does not keep any SQL session information from the original system.
Using option 4 will move the informaiton to a source physical file, and while you can move it to another system, you can not directly import it to STRSQL.  You can copy/paste however.
 
You can a STRSQL outputted source physical file as an 'input' to ACS Run SQL Scripts:
  • Within Run SQL Scripts, select File -> Open -> Source Physical File

If you write SQL queries via STRQM (ST1 LPP as well) using :

  1. STRQM 
  2. 1. Work with Query Manager queries
  3. F19=Change query creation mode
  4. 1 to create SQL or 10 to change a prompted query to SQL

then the SQL will be saved in a *QMQRY object that you can save/restore to another system.

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000001iIgAAI","label":"IBM i Db2-\u003ERUNSQL, RUNSQLSTM, STRSQL"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Historical Number

17672830

Document Information

Modified date:
04 December 2024

UID

nas8N1017932