How to Code SQL in PL/I Program (Part-1 of 2)

SQL Query to UPDATE in PL/I:

EXEC SQL UPDATE DSN8A10.DEPT

SET MGRNO = :MGR_NUM WHERE DEPTNO = :INT_DEPT ;

  • The above SQL statement you can use in your PL/I program. The terms EXEC and SQL should be in one line.
  • If you need you can use comments in between SQL statements.
  • You can use DCLGEN member in PL/I
    • EXEC SQL INCLUDE member-name;
  • We should not use PL/I pre-processor commands “%” in between SQL statement.

Read for more in my next post.

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.