I was using the standard STRSQL command and exited after use. When I exited I chose option 2=Exit without saving...
session, instead of option 1=Save and exit session. Now I have lost all my cumulative SQL history. Do you know where this data was kept? I may be able to restore it from my last backup. I have been unable to locate where the SQL statement history is kept.
Interactive SQL statement history is kept in an object named ISQLST-usrprf-devicename in the library QRECOVERY.
You can display the statement history with this command:
DMPSYSOBJ ISQLSTuuuuuddddd QRECOVERY TYPE(19) SUBTYPE(EE)
Unfortunately, Qrecovery does not get saved with the standard save commands. Unless you have explicitly saved objects from Qrecovery, I don't think you'll have anything to restore. If you had lost your SQL statement history due to changing your device name you might be able to retrieve it with the above command.
A more permanent way to save your statement history when exiting SQL is to use option 4=Save session in source file.
Dig Deeper on iSeries SQL commands and statements
Related Q&A from Scott Ingvaldson
When encountering problems using the SNDDST command to send a *LMSG on the iSeries, specify a valid SMTP name in the directory entry of the sender to... Continue Reading
When the HTTPS 443 port is not accessible from interned but is open within the local network, open the port for incoming connections by recognizing ... Continue Reading
If you receive an error following a QUSRSYS install on AS/400, you may need to reinstall while keeping a backup of the previous library because it ... Continue Reading