PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

Join the forum, it's quick and easy

PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).
PMS Information Systems
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Direct control of system names for tables, views and indexes

Go down

Direct control of system names for tables, views and indexes Empty Direct control of system names for tables, views and indexes

Post  maran Wed Feb 06, 2013 12:26 pm

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.

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.
maran
maran
Admin

Posts : 442
Join date : 2009-07-24

https://pmsinformationsystem.forumotion.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum