IBM Support

Direct control of system names for tables, views and indexes

News


Abstract

Direct control of system names for tables, views and indexes

Content

You are in: IBM i Technology Updates > Db2 for i - Technology UpdatesDb2 for i Functional Enhancements > Direct control of system names for tables, views and indexes

The FOR SYSTEM NAME clause directly defines the system name for these objects, eliminating the need to execute a RENAME after the object is created to replace the system generated name.

The name provided in the FOR SYSTEM NAME clause must be a valid system name and cannot be qualified. The first name provided for the object cannot be a valid system name.

The optional FOR SYSTEM NAME clause has been added to these SQL statements:

  • CREATE TABLE
  • CREATE VIEW
  • CREATE INDEX
  • DECLARE GLOBAL TEMPORARY TABLE
 

Use the FOR SYSTEM NAME clause to achieve direct control over table, view and index system names, making it simpler to manage the database.

This support eliminates the need to use the RENAME SQL statement or the Rename Object (RNMOBJ) command after object creation.

Additionally, the Generate SQL / QSQGNDDL() interface will leverage this enhancement to produce SQL DDL scripts that produce identical object names. When QSQGNDDL() is called using the System_Name_Option = '1', whenever the table, view or index objects has a system name which differs from the SQL name, the FOR SYSTEM NAME clause will be generated. For IBM i Navigator users, you control the System Name Option by selecting the "System names for objects" option.

Examples:

CREATE OR REPLACE VIEW
PRODLIB/COMPARE_YEARS_2012_AND_2011
FOR SYSTEM NAME COMP_12_11
AS SELECT …
COMP_12_11 *FILE object created instead of COMPA00001, COMPA00002, etc…
CREATE TABLE CUSTOMER_SALES FOR SYSTEM NAME SALES (CUSTNO BIGINT…
Generates a table with a system name of SALES, rather than a generated name of CUSTO00001.

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
14 January 2020

UID

ibm11167304