IBM Support

QSYS2.GENERATE_SQL() procedure

News


Abstract

The GENERATE_SQL procedure generates the SQL data definition language statements required to recreate a database object.

Content

The GENERATE_SQL procedure generates the SQL data definition language statements required to recreate a database object. The results are returned in the specified database source file member or as a result set.
See the procedure definition for details: GENERATE_SQL procedure

 
  • Generate DDL to tune the System Limits pruning variable:
    CALL QSYS2.GENERATE_SQL ('QIBM_SYSTEM_LIMITS_PRUNE_BY_OBJECT', 'SYSIBMADM', 'VARIABLE',
    REPLACE_OPTION => '0',
    CREATE_OR_REPLACE_OPTION => '1');


    Figure 1. Generate_SQL() example output:

    image-20200115130716-1
 

Enhanced with IBM i 7.5 SF99950 Level 1 and IBM i 7.4 SF99704 Level 20:

  1. When a view or MQT references a table or view in its definition that has a long name, the long name is generated in the DDL
  2. New option to generate the system object text as a COMMENT statement

Enhanced with IBM i 7.4 SF99704 Level 13 and IBM i 7.3 SF99703 Level 24:

  • Add the ability to generate into an IFS stream file

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
31 March 2023

UID

ibm11164760