Run list of queries in particular library using SQL on AS/400

Tags:
AS 400
AS/400 Query
SQL
I want to know how to run a list of queries in a particular library using SQL on the AS/400. Is that possible?
1

Answer Wiki

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

More info is needed on what you mean by list. 

Do you just need to see it or need it printed?

You could do something simple as run the command and send to
an *OUTFILE if you want something to QRY or just send it to *PRINT
DSPOBJD OBJ(MYLIB/*ALL) OBJTYPE(*QRYDFN) 
OUTPUT(*OUTFILE) OUTFILE(QTEMP/MY_QRYS)

and / or

DSPOBJD OBJ(MYLIB/*ALL) OBJTYPE(*QMQRY) 
OUTPUT(*OUTFILE) OUTFILE(QTEMP/MY_QRYS)

Discuss This Question: 2  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.
  • Subhendu Sen
    If you did mean, document library, you can try QRYDOCLIB, which allows to search for documents within the document library. However, there are several SQL for IBM query. For Open Query File (OPNQRYF), for Create Query (QQQQRY) API, for Open Database Connectivity (ODBC). Keep in mind, that the IBM Query for iSeries licensed program to create and run queries.
    138,940 pointsBadges:
    report
  • TheRealRaven
    "..LIST OF QUERIES", what do you mean? A 'query' may have multiple meanings. Do you want a series of reports resulting from different 'queries'? Do you need a hierarchical series of queries that result in a SQL VIEW? Please describe the final result of your request.

    If you're wanting a set of reports, you should understand that SQL doesn't do printing. Some type of 'Report Writer' function is needed. The most commonly available 'Report Writer' on the AS/400 series of systems is the Query Manager reporting feature. Interactive SQL can also take SQL result sets and send output to printer files, but it's impractical to use for a "list" of queries.

    Will the "list" be one-time or repeated periodically? Will the list content change? Are there parameter values that may change?

    "...USING SQL", what does that mean? Will these simply be SQL queries? Or does it mean that SQL will be only language available for use? No wrapping in CL for example?
    35,090 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.

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

Following

Share this item with your network: