Retrieve DDL (JRTVDDL0)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

Comando JRTVDDL0 (alias:JRTVDDL)

Retrieve DDL

Recupera DDL

Retrieve DDL (Data Definition Language) from existing object

Recupera le specifiche DDL da oggetto esistente

Il comando permette di recuperare in un membro sorgente la definizione DDL di un oggetto gia' esistente, in qualunque modo generato.

In pratica, si recuperano le specifiche che permettono la ricreazione dell'oggetto stesso con istruzioni SQL.

La generazione delle specifiche viene eseguita chiamando l'api QSQGNDDL "Generate Data Definition Language".

Il presente comando filtra semplicemente tutti i parametri richiesti dall'api rendendone piu' agevole l'uso.

A seguito del primo uso da parte del collega Massimo Duca, ho creato una seconda versione del solo comando per facilitargli la chiamata che lui ha usato come standard:

JRTVDDL0UF (alias: JRTVDDLUF) "UF Retrieve DDL"

Non dettaglio le differenze con la versione principale, rapidamente deducibili confrontando i due prompt.

Il presente help e' ricavato, senza traduzione ma con i necessari aggiustamenti, dallo spiegone IBM sull'api recuperato al link http://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/apis/qsqgnddl.htm

Retrieve Data Definition Language (JRTVDDL0) generates the SQL data definition language statements required to recreate a database object. The results are returned in the specified database source file member.

Database physical files or logical files that were created using an interface other than SQL may be specified. For example, files created from DDS and the CRTPF or CRTLF commands may be specified. Even if the object was created using SQL, the Standards option may restrict what can be generated. In either of these cases:

o the operation may succeed with warnings that are generated in the SQL statement source, or

o the operation may fail for certain non-relational files or objects not supported by the specified Standards option.

If a database object was created using an SQL interface, the resulting SQL statements may be slightly different than the SQL statements that created the object originally. For example:

o When there is more than one way to specify an attribute in SQL, the more standard syntax is generally chosen. For example, if a user creates a table with a FLOAT(52) column, DOUBLE PRECISION is generated.

o When a clause is not specified in the original SQL statement and a default is taken instead, a clause may be generated to explicitly show the default. For example, if the default value for a nullable column is the null value, the clause DEFAULT NULL is generated.

o When a Standards option is used to restrict the generated SQL to the ANS and ISO standard or the DB2® family, an attribute may be omitted. For example, if the ALLOCATE clause is specified on a VARCHAR column, the ALLOCATE clause is not generated unless the Standards option allows DB2 for IBM® i extensions.

For more information, see the Severity level field within the SQLR0100 Format.

You can use the JRTVDDL0 command with database objects only. DDM files (other than SQL aliases) are not supported. File overrides do not affect the specified object names. File overrides do affect the specified source file names.

Top

Parameters

Keyword Description Choices Notes
OBJNAME Database Object Name Name Required, Positional 1
OBJLIB Database Object Library Name, *CURLIB, *LIBL Required, Positional 2
OBJTYPE Database Object Type ALIAS, CONSTRAINT, FUNCTION, INDEX, PERMISSION, PROCEDURE, SCHEMA, SEQUENCE, TABLE, TRIGGER, TYPE, VARIABLE, VIEW, XSR Optional, Positional 3
SRCFILE Database Source File Name, QDDLSRC, QSQLSRC Optional, Positional 4
SRCLIB Database Source File Library Name, *CURLIB, *LIBL Optional, Positional 5
SRCMBR Database Source File Member Name, *OBJNAME, *FIRST, *LAST Optional, Positional 6
REPLACE Replace (Member) Option *REPLACE, *ADD Optional, Positional 7
STANDARDS Standards Option AS400, DB2, ISO Optional, Positional 8
NAMING Naming Option SYS, SQL Optional, Positional 9
DATFMT Date Format *JOB, ISO, EUR, JIS, USA, MDY, DMY, YMD, JUL Optional, Positional 10
DATSEP Date Separator *JOB, *SLASH, *PERIOD, *COMMA, *DASH, *BLANK Optional, Positional 11
TIMFMT Time Format ISO, EUR, JIS, USA, HMS Optional, Positional 12
TIMSEP Time Separator *JOB, *COLON, *PERIOD, *COMMA, *BLANK Optional, Positional 13
DECPOINT Decimal Point *COMMA, *PERIOD Optional, Positional 14
DROP Drop Option *YES, *NO Optional, Positional 15
COMMENT Comment Option *YES, *NO Optional, Positional 16
LABEL Label Option *YES, *NO Optional, Positional 17
SYSNAM System Name Option (RENAME) *NO, *YES Optional, Positional 18
SEVLVL Severity Level 0-39, 0, 10, 20, 30 Optional, Positional 19
MSGLVL Message Level 0-39, 0 Optional, Positional 20
STMFMT Statement Formatting Option *NO, *YES Optional, Positional 21
HEADER Header Option *NO, *YES Optional, Positional 22
TRIGGER Trigger Option *YES, *NO Optional, Positional 23
CONSTRAINT Constraint Option *ALTER, *CREATE, *NO Optional, Positional 24
PRIVILEGES Privileges Option *YES, *NO Optional, Positional 25
CCSID CCSID Option *YES, *NO Optional, Positional 26
CRTORRPL Create or Replace Option *YES, *NO Optional, Positional 27
OBFUSCATE Obfuscate Option *NO, *YES Optional, Positional 28
ACTIVATE Activate Row and Column Access *NO, *YES, '*INACTIVE_IN_V7R1' Optional, Positional 29
MASK Mask and Permission Option *NO, *YES, '*INACTIVE_IN_V7R1' Optional, Positional 30
QUALIFIED Qualified Name Option *UNQUAL, *QUAL Optional, Positional 31
ADDITIONAL Additional Index Option *NO, *YES Optional, Positional 32
INDEXVIEW Index instead of View Option *NO, *YES Optional, Positional 33
Top

Database Object Name (OBJNAME)

Nome dell'oggetto di database (OBJNAME)

Nome dell'oggetto di cui si vogliono recuperare le DDL.

The name of the database object for which DDL will be generated. Either the SQL name or the system name may be specified. The name is case sensitive. If delimiters are required for the name to be valid, they must be specified. For example, a file with a name of "abc" must be specified with the surrounding quotes. A file with a name of ABC must be specified in upper case.

If the object type is a FUNCTION or PROCEDURE, this name must be the specific name of the function or procedure.

If TABLE or VIEW is specified for the object type, the object name may identify an alias. In this case, the object that the alias points to will be generated. A CREATE ALIAS statement will be generated only if ALIAS is specified for the object type.

Valore obbligatorio:

nome-oggetto-database
Nome dell'oggetto di cui recuperare le DDL.
Top

Database Object Library (OBJLIB)

Libreria dell'oggetto di database (OBJLIB)

Libreria dell'oggetto di cui si vogliono recuperare le DDL.

The name of the library containing the object for which DDL will be generated. The name is case sensitive. If delimiters are required for the name to be valid, they must be specified. This name is ignored if the specified object type is SCHEMA. You can use these special values for the library name:

Valore obbligatorio:

nome-libreria
Nome della libreria o dello SCHEMA.

Valori speciali:

*CURLIB
The job's current library
*LIBL
The library list
Top

Database Object Type (OBJTYPE)

Tipo dell'oggetto di database (OBJTYPE)

Tipo dell'oggetto di cui si vogliono recuperare le DDL.

The type of the database object or object attribute for which DDL is generated. You can use these special values for the object type:

Valori permessi:

TABLE
The object is an SQL table or physical file.
ALIAS
The object is an SQL alias. If the Standards option is ISO, an ALIAS object type is not valid.
CONSTRAINT
The object attribute is a constraint.
FUNCTION
The object is an SQL function.
INDEX
The object is an SQL index. If the Standards option is ISO, an INDEX object type is not valid.
MASK
The object is an SQL column mask. If the Standards option is ISO, a MASK object type is not valid.
PERMISSION
The object is an SQL row permission. If the Standards option is ISO, a PERMISSION object type is not valid.
PROCEDURE
The object is an SQL procedure.
SCHEMA
The object is an SQL schema (collection) or library.
SEQUENCE
The object is an SQL sequence.
TRIGGER
The object attribute is a trigger.
TYPE
The object is an SQL type.
VARIABLE
The object is an SQL global variable. If the Standards option is ISO, an VARIABLE object type is not valid.
VIEW
The object is an SQL view or logical file.
XSR
The object is an XML schema repository object. If the Standards option is ISO, an XSR object type is not valid.
Top

Database Source File (SRCFILE)

Nome del file sorgente di emissione (SRCFILE)

File sorgente ricevente delle specifiche DDL recuperate.

The name of the source file that contains the SQL statements generated by the API. The name must be a valid system name. The name is case sensitive. If delimiters are required for the name to be valid, they must be specified. For example, a file with a name of "abc" must be specified with the surrounding quotes. A file with a name of ABC must be specified in upper case.

The record length of the specified source file must be greater than or equal to 92.

Valori permessi:

nome-file-sorgente
Nome del file sorgente.

Valori speciali:

QDDLSRC
Nome suggerito per il file sorgente.
QSQLSRC
Altro nome suggerito per il file sorgente.
Top

Database Source File Library (SRCLIB)

Libreria del file sorgente di emissione (SRCLIB)

Libreria del file sorgente ricevente delle specifiche DDL recuperate.

The name of the library containing the source file that contains the SQL statements generated by the API. The name must be a valid system name. The name is case sensitive. If delimiters are required for the name to be valid, they must be specified. You can use these special values for the library name:

Valori permessi:

nome-libreria
Nome della libreria del file sorgente.

Valori speciali:

*LIBL
The library list
*CURLIB
The job's current library
Top

Database Source File Member (SRCMBR)

Membro del file sorgente di emissione (SRCMBR)

Membro del file sorgente ricevente delle specifiche DDL recuperate.

The name of the source file member that contains the SQL statements generated by the API. The name must be a valid system name. The name is case sensitive. If delimiters are required for the name to be valid, they must be specified.

Valori permessi:

nome-membro
Nome del membro del file sorgente.

Valori speciali:

*OBJNAME
Lo stesso valore menzionato nel parametro OBJNAME.
*FIRST
The first database physical file member found.
*LAST
The last database physical file member found.
Top

Replace (Member) Option (REPLACE)

Opzione di sostituzione (REPLACE)

Aggiunge o sostituisce le specifiche generate nel membro sorgente.

The replace option for the database source file member.

Valori permessi:

*REPLACE
The database source file member is cleared prior to adding the resulting SQL statements. If this option is chosen, the file may be cleared even if an error is returned from the API.
*ADD
The resulting SQL statements are appended to the end of the database source file member.
Top

Standards Option (STANDARDS)

Opzione standard (STANDARDS)

Opzione degli standard di emissione.

The standards option specifies whether the generated SQL statements should contain DB2 for i extensions or whether the statements should conform to the DB2 family SQL or to the ANS and ISO SQL standards.

Valori permessi:

AS400
DB2 for i extensions may be generated in SQL statements.
DB2
The generated SQL statements must conform to SQL statements common to the DB2 family.
ISO
The generated SQL statements must conform to the following ANSI and ISO SQL standards:

oISO (International Standards Organization) 9075-1: 2003, Database Language SQL

oANSI (American National Standards Institute) X3.135-1-2003, Database Language SQL

If option DB2 or ISO is chosen, the SQL statements generated may not completely represent the object in DB2 for i; however, the statements will be compatible with the specified DB2 Family or ANSI and ISO standards option.

If the object is an SQL function, SQL procedure, SQL trigger, or SQL view, the SQL statements in the body of the object are included in the generated SQL statement. Hence, if the option DB2 or ISO is chosen, the generated SQL statement may not conform to the specified standards option since the statements within the body of the SQL object may not conform to the specified standard. For example, if a CREATE INDEX statement exists in the body of an SQL procedure, the generated CREATE PROCEDURE statement will contain the CREATE INDEX statement even if option DB2 or ISO is chosen.

There is no attempt to take product specific limits into account. For example, a table name in DB2 for i can be 128 bytes, but other products may not support table names that are that long. Thus, even if the generated SQL statement is standard, it still may not work on other products if they have smaller limits than those on DB2 for i. There is no attempt to take product specific limits into account. For example, a table name in DB2 for i can be 128 bytes, but other products may not support table names that are that long. Thus, even if the generated SQL statement is standard, it still may not work on other products if they have smaller limits than those on DB2 for i.

If option DB2 is specified,
oThe naming option must be SQL.
oThe date format must be ISO, USA, EUR, or JIS.
oThe time format must be ISO, USA, EUR, or JIS.
oThe decimal point must be the period.
oThe LABEL option must be 0.
oThe System name option must be 0.
oThe Create or Replace option must be 0.
oThe Obfuscate option must be 0.

If option ISO is specified,
oThe naming option must be SQL.
oThe date format must be ISO.
oThe time format must be ISO.
oThe decimal point must be the period.
oThe LABEL option must be 0.
oThe COMMENT option must be 0.
oThe System name option must be 0.
oThe CCSID option must be 0.
oThe Create or Replace option must be 0.
oThe Obfuscate option must be 0.
oThe Additional index option must be 0.
oThe Index instead of view option must be 0.
oThe Activate row and column access control option must be 0.
oThe Mask and permission option must be 0.
oAn ALIAS, VARIABLE, or XSR object type must not be specified.

Top

Naming Option (NAMING)

Ozione nomenclatura (NAMING)

Opzione di denominazione

The naming convention used for qualified names in the generated SQL statements.

Valori permessi:

SYS
library/file syntax

oIf the Standards option is DB2 or ISO, the SYS naming option is not valid.

oIf the object type is a FUNCTION, PROCEDURE, TRIGGER, or VIEW, and a column name is qualified by a qualified table name in the SQL body of the function, procedure, trigger, or view (that is, schema-name.table-name.column-name), the generated statement will not be valid because this type of column name qualification is not allowed in SYS naming.

SQL
collection.table syntax
Top

Date Format (DATFMT)

Formato data (DATFMT)

Formato della data.

The date format used for date constants in a generated SQL CREATE TABLE statement. The date format may not apply to date constants that are in ISO, EUR, USA, or JIS format in a CREATE VIEW, CREATE TRIGGER, CREATE FUNCTION, CREATE PROCEDURE, CREATE MASK, or CREATE PERMISSION statement.

Valori permessi:

*JOB
Formato data del lavoro corrente.
ISO
International Standards Organization (yyyy-mm-dd)
EUR
IBM European Standard (dd.mm.yyyy)

If the Standards option is ISO, the EUR date format is not valid.

JIS
Japanese Industrial standard Christian Era (yyyy-mm-dd)

If the Standards option is ISO, the JIS date format is not valid.

USA
IBM USA standard (mm/dd/yyyy)

If the Standards option is ISO, the USA date format is not valid.

MDY
Month/day/year (mm/dd/yy)

If the Standards option is DB2 or ISO, the MDY date format is not valid.

DMY
Day/month/year (dd/mm/yy)

If the Standards option is DB2 or ISO, the DMY date format is not valid.

YMD
Year/month/day (yy/mm/dd)

If the Standards option is DB2 or ISO, the YMD date format is not valid.

JUL
Julian (yy/ddd)

If the Standards option is DB2 or ISO, the JUL date format is not valid.

Top

Date Separator (DATSEP)

Separatore data (DATSEP)

Carattere separatore della data.

The date separator used for date constants in a generated SQL CREATE TABLE statement. The date separator may not apply to date constants that are in ISO, EUR, USA, or JIS format in a CREATE VIEW, CREATE TRIGGER, CREATE FUNCTION, CREATE PROCEDURE, CREATE MASK, or CREATE PERMISSION statement. The date separator is only applicable if the date format is MDY, DMY, YMD, or JUL.

Valori permessi:

*JOB
Separatore data del lavoro corrente.
*SLASH
"/" Slash separator
*PERIOD
"." Period separator
*COMMA
"," Comma separator
*DASH
"-" Dash separator
*BLANK
" " Blank separator
Top

Time Format (TIMFMT)

Formato ora (TIMFMT)

Formato dell'orario.

The format used for time constants in a generated SQL CREATE TABLE statement. The time format may not apply to time constants that are in ISO, EUR, USA, or JIS format in a CREATE VIEW, CREATE TRIGGER, CREATE FUNCTION, CREATE PROCEDURE, CREATE MASK, or CREATE PERMISSION statement in the generated SQL statements.

Valori permessi:

ISO
International Standards Organization (hh.mm.ss)
EUR
IBM European Standard (hh.mm.ss)

If the Standards option is ISO, the EUR time format is not valid.

JIS
Japanese Industrial standard Christian Era (hh:mm:ss)

If the Standards option is ISO, the JIS time format is not valid.

USA
IBM USA standard (hh:mm AM, hh:mm PM)

If the Standards option is ISO, the USA time format is not valid.

HMS
Hour/minute/second (hh:mm:ss)

If the Standards option is DB2 or ISO, the HMS time format is not valid.

Top

Time Separator (TIMSEP)

Separatore ora (TIMSEP)

Carattere separatore dell'orario.

The time separator used for time constants in a generated SQL CREATE TABLE statement. The time separator may not apply to time constants that are in ISO, EUR, USA, or JIS format in a CREATE VIEW, CREATE TRIGGER, CREATE FUNCTION, CREATE PROCEDURE, CREATE MASK, or CREATE PERMISSION statement. The time separator is only applicable if the time format is HMS in the generated SQL statements.

Valori permessi:

*JOB
Separatore ora del lavoro corrente.
*COLON
":" Colon separator
*PERIOD
"." Period separator
*COMMA
"," Comma separator
*BLANK
" " Blank separator
Top

Decimal Point (DECPOINT)

Virgola decimale (DECPOINT)

Carattere separatore dei decimali.

The decimal point used for numeric constants.

Valori permessi:

*COMMA
"," Comma separator
*PERIOD
"." Period separator
Top

Drop Option (DROP)

Opzione cancellazione (DROP)

Opzione di scrittura della specifica di cancellazione.

The drop option specifies whether DROP (or ALTER) SQL statements should be generated prior to the CREATE statement to drop the specified object.

Valori permessi:

*YES
DROP statements should be generated.
*NO
DROP statements should not be generated.

Note that with the exception of DROP SCHEMA, the DROP statements generated will not include a CASCADE or RESTRICT option even if the standards option is ISO.

Top

Comment Option (COMMENT)

Opzione commenti (COMMENT)

Opzione di recupero commenti.

The comment option specifies whether COMMENT ON SQL statements should be generated if a comment exists on the specified database object. If comments are not supported by the specified database object, the comment option is ignored.

Valori permessi:

*YES
COMMENT ON SQL statements should be generated. If the specified database object type is a table or view, COMMENT ON SQL statements will also be generated for columns of the table or view.
*NO
COMMENT ON SQL statements should not be generated.

If the Standards option is ISO, comment option *YES is not valid.

Top

Label Option (LABEL)

Opzione etichette (LABEL)

Opzione di recupero etichette.

The label option specifies whether LABEL ON SQL statements should be generated if a label exists on the specified database object. If labels are not supported by the specified database object, the label option is ignored.

Valori permessi:

*YES
LABEL ON SQL statements should be generated. If the specified database object type is a table or view, LABEL ON SQL statements will also be generated for columns of the table or view.
*NO
LABEL ON SQL statements should not be generated.

If the Standards option is DB2 or ISO, label option *YES is not valid.

Top

System Name Option (Rename) (SYSNAM)

Opzione nomi sistema (SYSNAM)

Opzione nomi di sistema.

The system name option specifies whether a RENAME statement should be generated for the system name when it is different from the SQL name and the object type is an INDEX, TABLE, or VIEW.

Valori permessi:

*NO
A RENAME statement should not be generated.
*YES
A RENAME statement should be generated.

If the Standards option is DB2 or ISO, system name option *YES is not valid. The default is *NO.

Top

Severity Level (SEVLVL)

Livello gravita' (SEVLVL)

Livello di gravita' tollerato.

The severity level at which the operation fails. If errors occur that have a severity level greater than this value, the operation ends. The valid values are in the range 0 through 39 inclusive. Any severity 40 error will cause the API to fail.

Valori permessi:

0
No errors or warnings.
10
The following attributes will result in messages with this severity level:

o Schema ASP and WITH DATA DICTIONARY.

If the Standards option is DB2 or ISO, these clauses will be ignored.

o Test libraries.

A CREATE SCHEMA statement will be generated to create the schema. Schemas are production libraries.

o Libraries with a CRTAUT parameter value.

Under SQL naming, schemas are always created with CRTAUT(*EXCLUDE). Under SYS naming, schemas are always created with CRTAUT(*SYSVAL).

o NODEGROUPs.

If the Standards option is DB2 or ISO, the NODEGROUP clause will be ignored.

o COMMENT ON parameters.

If the Standards option is DB2, the comment will be ignored.

o System file names.

If the Standards option is DB2 or ISO, only the SQL names are generated. Otherwise, FOR SYSTEM NAME clause is generated to assign the system file name.

o System column names.

If the Standards option is DB2 or ISO, only the SQL names are generated. Otherwise, a FOR COLUMN clause will be generated to assign each system column name.

o BIGINT data types.

If the Standards option is DB2 or ISO, a DECIMAL(19,0) will be generated.

o DBCS-open data types.

If the Standards option is DB2 or ISO, a character field will be generated.

o Binary with non-zero scale.

A decimal data type will be generated.

o Files whose format name is different from the file name.

If the Standards option is DB2 or ISO, the format name will be the same as the file name. Otherwise, a RCDFMT clause will be generated to assign the format name.

o Files with a REUSEDLT(*NO) attribute.

REUSEDLT(*YES) will be used.

o Physical or logical files that use any of the following keywords: CHECK, CHKMSGID, CMP, DATFMT, EDTCDE, EDTWRD, TIMFMT, RANGE, REFSHIFT, VALUES.

These keywords will be ignored.

o Logical files that use any of the following keywords: CCSID or TRNTBL.

These keywords will be ignored.

o Join logical files with JDFTVAL or JDUPSEQ.

A LEFT OUTER JOIN clause will be generated, but the join default value will be the null value and the JDUPSEQ keyword will be ignored.

o Logical files with SST function.

If the Standards option is ISO, SUBSTRING is generated instead of SUBSTR.

o COBOLLE and C++ languages in external functions and procedures.

If the Standards option is DB2 or ISO, COBOL or C is generated.

o RPGLE language in external functions and procedures.

If the Standards option is DB2, RPG is generated.

20
The following attributes will result in messages with this severity level:

o Multiple member files, files with no members, or files with MAXMBRS greater than one.

The resulting file will contain one member.

o Single format logical files with a member built over multiple physical file members.

The resulting file will be based on the first physical file member.

o Logical files that contain input/output fields that map an underlying physical file field to a different data type, length, precision or scale.

A CAST scalar function will be generated to map the data to the correct attributes, but the resulting column is input-only.

o Keyed logical files that do not share the based on physical file's format or have more than one based on file.

If INDEX is specified, the format will be ignored.

o Triggers with MODE DB2ROW.

If the Standards option is DB2 or ISO, MODE DB2SQL will be used.

30
The following attributes will result in messages with this severity level:

o CHAR or VARCHAR CCSID 65535.

If the Standards option is ISO, a character field is generated.

o GRAPHIC, VARGRAPHIC, or DBCLOB.

If the Standards option is ISO, a character field is generated.

o DataLinks or Row IDs.

If the Standards option is DB2 or ISO, a character field is generated.

o Open, Only, or Either fields.

If the Standards option is AS400, the CCSID clause will result in an open field. Only and Either fields will result in a warning. If the Standards option is DB2, FOR MIXED DATA is generated. If the Standards option is ISO, character fields will be generated.

o Keyed logical files.

If VIEW is specified, the key specifications will be ignored unless the Index instead of view option 1 is specified, because all views are non-keyed.

o Keyed physical files whose key is not a primary key.

A CREATE TABLE will be generated without a primary key. The key specifications will be ignored, however, because only tables with a primary key are keyed.

o Files that use any of the following keywords: ALTSEQ, DIGIT, FCFO, FIFO, LIFO, UNSIGNED, ZONE.

These keywords will be ignored.

o SRTSEQ.

The sort sequence will be ignored.

o Non-SQL triggers if TABLE object is specified.

The triggers will be ignored.

o NO EXTERNAL ACTION, SCRATCHPAD, FINAL CALL, ALLOW PARALLEL, or DBINFO, keywords in functions and procedures.

If the standards option is ISO, these attributes will be ignored.

o COMMIT ON RETURN YES, NOT FENCED, or NEW SAVEPOINT LEVEL clauses in functions and procedures.

If the standards option is DB2 or ISO, these attributes will be ignored.

o Functions and procedures with parameter style GENERAL WITH NULLS, DB2SQL, or DB2GENERAL.

If the Standards option is ISO, PARAMETER STYLE SQL is used.

o JAVA, REXX, RPG, and RPGLE language in functions and procedures.

If the Standards option is ISO, the C language is used instead.

o CL language in functions and procedures.

If the Standards option is DB2 or ISO, the C language is used instead.

40
The following attributes will result in messages with this severity level:

o Physical file if either VIEW or INDEX object type is specified.

o Logical file if TABLE object type is specified.

o Non-keyed file if INDEX object type is specified.

o Non-alias file if ALIAS object type is specified.

o Function if PROCEDURE object type is specified.

o Procedure if FUNCTION object type is specified.

o Device files

o Program described physical files

o Multiple format logical files

o Indexes if the Standards option is ISO.

o Aliases if the Standards option is ISO.

o EVI Indexes if the Standards option is DB2.

o Variables if the Standards option is ISO.

o XSR Objects if the Standards option is ISO.

o Masks if the Standards option is ISO.

o Permissions if the Standards option is ISO.

o UNIQUE WHERE NOT NULL if the Standards option is DB2.

o Aliases that contain a member name if the Standards option is DB2.

o System-generated UDFs

o Built-in data types

o SQL UDFs, if the Standards option is DB2.

o Sourced UDFs, if the Standards option is ISO.

o User-defined table functions, if the Standards option is ISO.

o Non-SQL triggers if TRIGGER object is specified.

Top

Message Level (MSGLVL)

Livello messaggi (MSGLVL)

Livello massimo tollerato per i messaggi.

The severity level at which the messages are generated. If errors occur that have a severity level greater than this value, a message is generated in the output.

Valori permessi:

0
Tutti i messaggi vengono segnalati.
0-39
The valid values are in the range 0 through 39 inclusive.

The message level must be less than or equal to the severity level.

Top

Statement Formatting Option (STMFMT)

Opzione formattazione istruzioni (STMFMT)

Opzione di formattazione delle istruzioni.

The formatting option used in the generated SQL statements.

Valori permessi:

*NO
No additional formatting characters are added to the generated SQL statements.
*YES
Additional end-of-line characters and tab characters are added to the generated SQL statements.
Top

Header Option (HEADER)

Ozione intestazioni (HEADER)

Opzione di generazione dei commenti di intestazione.

The header option specifies whether a header should be generated prior to the CREATE statement. The header consists of comments that describe the version, date and time, the relational database, and some of the options used to generate the SQL statements.

Valori permessi:

*NO
A header should not be generated.
*YES
A header should be generated.
Top

Trigger Option (TRIGGER)

Opzione trigger (TRIGGER)

Opzione di generazione trigger.

The trigger option specifies whether triggers should be generated when the object type is a TABLE or VIEW.

Valori permessi:

*YES
Triggers should be generated.
*NO
Triggers should not be generated.
Top

Constraint Option (CONSTRAINT)

Opzione costrizioni (CONSTRAINT)

Opzione di generazione costrizioni.

The constraint option specifies whether constraints should be generated when the object type is a TABLE.

Valori permessi:

*ALTER
Constraints should be generated using ALTER TABLE statements.

Prima di V7R2, era *YES.

*CREATE
Constraints should be generated as part of the CREATE TABLE statement.

Permesso da V7R2.

*NO
Constraints should not be generated.
Top

Privileges Option (PRIVILEGES)

Opzione privilegi (PRIVILEGES)

Opzione di generazione privilegi.

The privileges option specifies whether GRANT SQL statements should be generated on the specified database object. If privileges are not supported by the specified database object, the privileges option is ignored.

Valori permessi:

*YES
GRANT SQL statements should be generated.
*NO
GRANT SQL statements should not be generated.

To generate privileges for an external routine, the external routine must exist.

Only SQL privileges will be generated for the specified database object. Authorities acquired through a group user profile, authorization list, special authority (such as *ALLOBJ) or any authority granted through GRTOBJAUT that does not map directly to an SQL privilege are not generated.

Top

CCSID Option (CCSID)

Opzione CCSID (CCSID)

Opzione generazione CCSID campi.

The CCSID option specifies whether the CCSID attribute should be generated for column definitions when the object type is a TABLE.

Valori permessi:

*YES
CCSID attribute should be generated.
*NO
CCSID atrribute should not be generated.

If the standards option is AS400 and *NO is specified, the CCSID clause, FOR MIXED DATA, FOR SBCS DATA, or FOR BIT DATA is not generated for the column definition.

If the standards option is DB2 and *NO is specified, FOR MIXED DATA, FOR SBCS DATA, or FOR BIT DATA is not generated for the column definition.

If the standards option is ISO the CCSID option is ignored.

Top

Create or Replace Option (CRTORRPL)

Opzione crea o sostituisci (CRTORRPL)

Opzione di generazione di creazione o sostituzione.

The Create or Replace option specifies whether CREATE OR REPLACE should be generated for the specified database object on the CREATE statement. This option is ignored if the specified database object does not support CREATE OR REPLACE.

Valori permessi:

*YES
CREATE OR REPLACE should be generated.
*NO
CREATE OR REPLACE should not be generated.

If the Standards option is DB2 or ISO, the CREATE OR REPLACE option is not valid.

Top

Obfuscate Option (OBFUSCATE)

Opzione offuscamento (OBFUSCATE)

Opzione di recupero delle istruzioni offuscate.

The obfuscate option specifies whether an obfuscated SQL statement should be returned for SQL functions, SQL procedures, or SQL triggers that were not created using obfuscated statements. This option is ignored if the standards option is not AS400. This option is also ignored if the object is not an SQL function, procedure, or trigger. This option is ignored if the object is already obfuscated. Setting Obfuscate option = *NO cannot be used as a means of obtaining the unobfuscated SQL statement for an obfuscated object.

Valori permessi:

*NO
An obfuscated statement should not be generated.
*YES
An obfuscated statement should be generated for SQL functions, SQL procedures, or SQL triggers.
Top

Activate Row and Column Access (ACTIVATE)

Opzione accesso riga colonna (ACTIVATE)

Opzione di attivazione dell'accesso riga colonna.

The activate row and column access control option specifies whether an ALTER TABLE to activate row and column access control should be generated when the object type is a TABLE.

Valori permessi:

*INACTIVE_IN_V7R1
Parametro valido da V7R2.
*NO
Activate row and column access control should not be generated.
*YES
Activate row and column access control should be generated.

If the Standards option is ISO, activate row and column access control option *YES is ignored.

Top

Mask and Permission Option (MASK)

Opzione maschera e permesso (MASK)

Opzione di generazione maschera colonna e permesso riga.

The mask and permission option specifies whether row permissions and column masks should be generated when the object type is a TABLE.

Valori permessi:

*INACTIVE_IN_V7R1
Parametro valido da V7R2.
*NO
Permissions and masks should not be generated.
*YES
Permissions and masks should be generated.

If the Standards option is ISO, mask and permission option *YES is ignored.

Top

Qualified Name Option (QUALIFIED)

Opzione nomi qualificati (QUALIFIED)

Opzione di generazione di nomii qualificati per il database.

The qualified name option specifies whether qualified or unqualified names should be generated for the specified database object.

Valori permessi:

*QUAL
Qualified object names should be generated. Unqualified names within the body of SQL routines will remain unqualified.
*UNQUAL
Unqualified object names should be generated when a library is found which matches the database object library name. Any SQL object or column reference that is RDB qualified will be generated in its fully qualified form. For example, rdb-name.schema-name.table-name and rdb-name.schema-name.table-name.column-name references will retain their full qualification.
Top

Additional Index Option (ADDITIONAL)

Opzione indice aggiuntivo (ADDITIONAL)

Opzione di creazione indice aggiuntivo.

The additional index option specifies whether additional CREATE INDEX statements will be generated for DDS-created keyed physical or logical files.

Valori permessi:

*NO
Additional CREATE INDEX statements will not be generated.
*YES
An additional CREATE INDEX statement will be generated that matches the index for a DDS-created keyed physical file. If the physical file has a PRIMARY KEY constraint, a CREATE INDEX statement is not generated.

An additional CREATE INDEX statement will be generated that matches the index for a DDS-created keyed logical file. If a value of *YES is specified for the "index instead of view option", an additional CREATE INDEX statement is not generated. Additional CREATE INDEX statements will also be generated that match the join indexes of a DDS-created join logical file.

If the Standards option is ISO, additional index option *YES is not valid.

Top

Index instead of View Option (INDEXVIEW)

Opzione indice invece di vista (INDEXVIEW)

Opzione di generazione di indice invece che vista.

The Index instead of view option specifies whether a CREATE INDEX or CREATE VIEW statement will be generated for a DDS-created keyed logical file.

Valori permessi:

*NO
A CREATE VIEW statement will be generated.
*YES
A CREATE INDEX statement will be generated that matches the index for a DDS-created keyed logical file.

This option is ignored if VIEW is not specified for the Database object type or if the specified file is not keyed.

If the specified file is keyed, the CREATE INDEX statement will be generated as if a Database object type of INDEX was specified.

If the Standards option is ISO, index instead of view option *YES is not valid.

Top

Esempi per JRTVDDL0

Esempio 1: Recupero sorgente DDL da file fisico

Si abbia il file fisico JSMP1 creato a suo tempo con il comando:

> CRTPF FILE(NERONI1/JSMP1) SRCFILE(NERONI2/JSMP) SRCMBR(JSMP1)
  File JSMP1 creato nella libreria NERONI1.
  Membro JSMP1 aggiunto al file JSMP1 in NERONI1.

A partire dal sorgente:

A          R JSMP1R                    TEXT('Anagrafico')
A            A1ANNU         1          COLHDG('Annullamento')
A                                      VALUES(' ' 'A')
A            A1CDFI        16          COLHDG('Codice' 'fiscale')
A            A1COGN        15          COLHDG('Cognome')
A            A1CAPX         5  0       COLHDG('Cap')
A                                      EDTCDE(L)
A            A1NOME        20          COLHDG('Nome')
A            A1DTNA          L         COLHDG('Data' 'nascita')

Si crea un file sorgente vuoto per ricevere il sorgente DDL da recuperare:

> CRTSRCPF FILE(QTEMP/QDDLSRC)
  File QDDLSRC created in library QTEMP.

Si esegue il recupero DDL:

> JRTVDDL OBJNAME(JFDR1) OBJLIB(NERONI2) SRCLIB(QTEMP)
  Generate DDL.

Si ottiene il seguente sorgente DDL recuperato:

DROP TABLE JSMP1 ;
CREATE OR REPLACE TABLE JSMP1 (
--  SQL150B   10   REUSEDLT(*NO) nella tabella JSMP1 in NERONI2
                   ignorata.
  A1ANNU CHAR(1) CCSID 280 NOT NULL DEFAULT '' ,
--  SQL150D   10   VALUES nella colonna A1ANNU ignorato.
  A1CDFI CHAR(16) CCSID 280 NOT NULL DEFAULT '' ,
  A1COGN CHAR(15) CCSID 280 NOT NULL DEFAULT '' ,
  A1CAPX DECIMAL(5, 0) NOT NULL DEFAULT 0 ,
--  SQL150D   10   EDTCDE nella colonna A1CAPX ignorato.
  A1NOME CHAR(20) CCSID 280 NOT NULL DEFAULT '' ,
  A1DTNA DATE NOT NULL DEFAULT CURRENT_DATE )
  RCDFMT JSMP1R     ;
LABEL ON TABLE JSMP1
  IS 'Sample. Anag' ;
LABEL ON COLUMN JSMP1
( A1ANNU IS 'Annullamento' ,
  A1CDFI IS 'Codice              fiscale' ,
  A1COGN IS 'Cognome' ,
  A1CAPX IS 'Cap' ,
  A1NOME IS 'Nome' ,
  A1DTNA IS 'Data                nascita' ) ;
LABEL ON COLUMN JSMP1
( A1ANNU TEXT IS 'Annullamento' ,
  A1CDFI TEXT IS 'Codice fiscale' ,
  A1COGN TEXT IS 'Cognome' ,
  A1CAPX TEXT IS 'Cap' ,
  A1NOME TEXT IS 'Nome' ,
  A1DTNA TEXT IS 'Data nascita' ) ;
GRANT ALTER , DELETE , INDEX , INSERT , REFERENCES , SELECT ,
  UPDATE
ON JSMP1 TO NERONI WITH GRANT OPTION ;
--  SQL7040   40   La severita' del messaggio 10 supera il
--                 livello di severita' specificato 0.
--  SQL7046   40   Creazione di SQL per JSMP1 in NERONI2 tipo
--                 di oggetto TABLE  non riuscito.

Esempio 2: Riattivazione collegamento a database SQL

Se il comando risponde picche come segue:

> JRTVDDL OBJNAME(JFDR1) OBJLIB(NERONI2) SRCLIB(QTEMP)
  Il processo di applicazione non e' in uno stato Connesso.
  Generazione DDL fallita.

Per riconnettere la propria sessione al database SQL, si avvia SQL:

> STRSQL

Sul video SQL si usano i comandi:

Per disconnettere la sessione:
> DISCONNECT CURRENT
  DISCONNECT completato.
Per valutare lo stato di connessione:
> CONNECT
  Il processo di applicazione non e' in uno stato Connesso.
oppure
  Il collegamento corrente e' al database relazionale DEV720.
Per ripristinare la connessione, una delle due:
> CONNECT RESET
  Il collegamento corrente e' al database relazionale DEV720.
> SET CONNECTION DEV720
  Il collegamento corrente e' al database relazionale DEV720.

Dopodiche' si ritenta il comando fallito.

Top

Messaggi di errore

Messaggi vari

CPF24B4
Si è verificato un errore grave durante l'indirizzamento dell'elenco dei parametri.
CPF3C21
Il nome del formato &1 non è valido.
CPF3C23
L'oggetto &1 non è un file di tipo corretto.
CPF3C26
Il file &1 non ha membri.
CPF3C39
Valore per il campo riservato non valido.
CPF3C3A
Il valore per il parametro &2 per l'API &1 non è valido.
CPF3C90
Impossibile modificare il valore della costante letterale.
CPF3CF1
Il parametro codice di errore non è valido.
JRD81AA
All CPF81xx messages could be returned. xx is from 01 to FF.
JRD98AA
All CPF98xx messages could be signaled. xx is from 01 to FF.
SQL0113
Nome &1 non consentito.
SQL7001
La tabella &1 in &2 non è un file di database.
SQL7003
Il file &1 in &2 ha più di un formato.
SQL7011
&1 in &2 non file tabella, vista o fisico.
SQL7039
Valori campo mascherina di immissione QSQGNDDL API non compatibili.
SQL7040
La severità del messaggio &1 supera il livello di severità specificato &2.
SQL7041
&1 in &2 non valido per il tipo di oggetto &3.
SQL7042
Valore non valido per la mascherina di immissione QSQGNDDL API.
SQL7043
Funzione creata dal sistema o tipo di dati incorporati &1 in &2 non consentiti.
SQL7044
&3 non supportato dall'opzione standard per &1 in &2.
SQL7045
Funzione &1 in &2 non consentita.
SQL7046
Creazione di SQL per &1 in &2 tipo di oggetto &3 non riuscito.
SQL7047
Trigger del sistema &1 in &2 non consentito.
Top