Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
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 |
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 |
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:
Top |
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:
Valori speciali:
Top |
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:
Top |
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:
Valori speciali:
Top |
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:
Valori speciali:
Top |
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:
Valori speciali:
Top |
Aggiunge o sostituisce le specifiche generate nel membro sorgente.
The replace option for the database source file member.
Valori permessi:
Top |
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:
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 |
Opzione di denominazione
The naming convention used for qualified names in the generated SQL statements.
Valori permessi:
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.
Top |
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:
If the Standards option is ISO, the EUR date format is not valid.
If the Standards option is ISO, the JIS date format is not valid.
If the Standards option is ISO, the USA date format is not valid.
If the Standards option is DB2 or ISO, the MDY date format is not valid.
If the Standards option is DB2 or ISO, the DMY date format is not valid.
If the Standards option is DB2 or ISO, the YMD date format is not valid.
If the Standards option is DB2 or ISO, the JUL date format is not valid.
Top |
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:
Top |
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:
If the Standards option is ISO, the EUR time format is not valid.
If the Standards option is ISO, the JIS time format is not valid.
If the Standards option is ISO, the USA time format is not valid.
If the Standards option is DB2 or ISO, the HMS time format is not valid.
Top |
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:
Top |
Carattere separatore dei decimali.
The decimal point used for numeric constants.
Valori permessi:
Top |
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:
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 |
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:
If the Standards option is ISO, comment option *YES is not valid.
Top |
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:
If the Standards option is DB2 or ISO, label option *YES is not valid.
Top |
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:
If the Standards option is DB2 or ISO, system name option *YES is not valid. The default is *NO.
Top |
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:
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.
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.
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.
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 |
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:
The message level must be less than or equal to the severity level.
Top |
Opzione di formattazione delle istruzioni.
The formatting option used in the generated SQL statements.
Valori permessi:
Top |
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:
Top |
Opzione di generazione trigger.
The trigger option specifies whether triggers should be generated when the object type is a TABLE or VIEW.
Valori permessi:
Top |
Opzione di generazione costrizioni.
The constraint option specifies whether constraints should be generated when the object type is a TABLE.
Valori permessi:
Prima di V7R2, era *YES.
Permesso da V7R2.
Top |
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:
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 |
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:
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 |
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:
If the Standards option is DB2 or ISO, the CREATE OR REPLACE option is not valid.
Top |
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:
Top |
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:
If the Standards option is ISO, activate row and column access control option *YES is ignored.
Top |
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:
If the Standards option is ISO, mask and permission option *YES is ignored.
Top |
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:
Top |
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:
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 |
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:
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 |
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 vari
Top |