SQL/400 commands

440 pts.
Tags:
AS/400 and SQL
SQL/400
Hi friends, How can I see or get the SQL/400 commands executed from another user ? Regards, Roberto

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

As far as I know it’s not possible to see the SQL commands that another user has executed. I guess that the system stores this data somewhere, but I’ve never seen any method of retrieving it.

Regards,

Martin Gilbert.

Hi,
i hope DSPJOBLOG may have the contentsabout these SQL statement.

thanks
Ram

Unfortunately, DSPJOBLOG does not contain anything about SQL commands from a STRSQL session. You may see informational messages like number of rows updated/deleted etc, but you will not see how this has been done.

Regards,

Martin.

Have the person use option 4 (4=Save session in source file ) when they exit SQL. You will be able to see and copy all commands.

Steve

You can’t force the users to take option 4 to save the session, but there must be a copy of the session stored somewhere, because when you start SQL your previous session is restored (if you exited with option 1 from your previous session). Does anybody know where this is stored?

Regards,

Martin.

Discuss This Question: 9  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Sloopy
    Hi, all. The session information is stored in the QRECOVERY library, in an object called ISQLSTaaaaaaaaaabbbbbbbbbbbbbb, where aaaaaaaaaa = User ID and bbbbbbbbbbbbbb = Device name. So, for example, my session history is in "ISQLSTBLECMD QPADEV000G0000". As you can see, this is not a normal object name! Use the DMPOBJ command to dump the object to a spooled file: DMPSYSOBJ OBJ(ISQLSTBLECMD*) CONTEXT(QRECOVERY) TYPE(19) SUBTYPE(EE) - It's best to use the generic name, since there is not much chance otherwise of finding out the full name of the object. The dump output is readable, and it would be quite easy to write a program to read it and create a file of the SQL statements. Now, I have to say that I found this information HERE: http://search400.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid3_gci1311580,00.html ...and the expert who found the answer is Scott Ingvaldson. Regards, Sloopy.
    2,195 pointsBadges:
    report
  • GAC
    Excellent!!, an excellent piece of knowledge to have at hand. Cheers, Gerardo
    300 pointsBadges:
    report
  • SILVARB
    Friends, I would like to thanks for all, I am very grateful for the help. PS: “Sharing we generate knowledge” or "Compartiendo generamos Conocimiento" or "Compartindo geramos conhecimento" Regards, Roberto
    440 pointsBadges:
    report
  • Haaiderali
    Hi Sloopy, Thanks for the Command. It's will be of Great Help..... Haaider Ali
    215 pointsBadges:
    report
  • Sloopy
    Bu ke qi (since we seem to be a multi-lingual community here....) But, thank Scott Ingvaldson instead. I just used Google! Sloopy
    2,195 pointsBadges:
    report
  • Mohan K
    Hi Sloopy, I am unable to find ISQLST* object in my QRECOVERY library can u please help me.
    695 pointsBadges:
    report
  • Sloopy
    hi, Mohan. You won't be able to see the ISQLST* objects using DSPOBJD or WRKOBJ, because they are not the type of object that can be worked with in that way. You can't even see these objects in Ops Navigator! You have to use the DMPSYSOBJ command, which will dump the objects as described in my earlier answer. Regards, Sloopy
    2,195 pointsBadges:
    report
  • Haaiderali
    Sloopy, can we use the DMPSYSOBJ Command to track SQL Statements executed by ODBC Connections? We have a userid by which specific SELECT QUERIES will be executed through a 3rd Party Software via ODBC Connection and the interactive Sign - On for this userid has been disabled. The 4 or 5 SELECT QUERIES have been approved by the Application Owner and so we need to track all the SQL Statements executed by this userid on daily basis so that if any other queries, apart from the ones which are approved, are run by this userid then it needs to be highlighted.
    215 pointsBadges:
    report
  • TomLiotta
    ...can we use the DMPSYSOBJ Command to track SQL Statements executed by ODBC Connections? Yes, if the statements were captured; but you'll have to find the appropriate objects each time. They won't be in the ISQLST* objects that were mentioned earlier in this thread. Those are created and used only by interactive SQL, i.e., STRSQL, not by ODBC. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following