Dynamic execution of SQL statement on iseries

Source: Internet
Author: User

The previous method was very stupid. It was to concatenate each field into a string using the | method.
In fact, only now can we find that we can use runsqlstmt to run this SQL statement and then output it to a spool file.
The following is the idea:
1. Assemble the SQL statement, the old oneProgramAvailable
2. output the assembled SQL statement to the default member of qtemp/runsqlsrc.
3. Call runsqlstmt to execute the SQL statement.
4. Copy the output spool file to PF.
5. Copy to folder or Sendmail if you like to download
So it will be easy to translate to excel.


However, it is only an idea, and there is no time to build it.
Advantages:
1. Supports dynamic SQL
2. A general query can be made based on dynamic SQL, and a search range can be input to the customer.
3. You can save the query results to PF for customers to download.
4. Multiple SQL statements can be separated by semicolons.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.