Start of change

Using reserved words as correlation names

With IBM® i 7.2 PTF SI67939, the use of reserved words as a table correlation name became more restrictive. The table correlation name is the identifier that follows a table name, table function, nested table expression, among others that can be used to qualify columns returned from the table.

To identify static SQL statements that might contain this problem, run a query like the following. This example is looking for the reserved word INNER when it is not used as join syntax.

SELECT  b.statement_text, a.system_program_name, a.program_type
          FROM qsys2.sysprogramstat a INNER JOIN
               qsys2.sysprogramstmtstat b ON a.program_schema = b.program_schema AND
                                             a.program_name = b.program_name AND
                                             a.module_name = b.module_name 
          WHERE a.program_schema = 'MYLIB' AND 
               b.statement_text LIKE '%INNER%' and b.statement_text NOT LIKE '%INNER JOIN%'
End of change