Customizing Table DDL or Object JSON

From ER/Studio Data Architect
Jump to: navigation, search

Go Up to Physical Storage Considerations

Using the Table DDL tab

The options selected in the Table Editor determine the clauses used in the CREATE TABLE and CREATE INDEX statements. Options on the DDL tab can give you more control over the DDL created.

  1. Double-click a table to open the Table Editor.
  2. Click the DDL tab and then click Customize.

Notepad blue icon 2.pngNote: If the DDL is not displaying the options you expect to see, it may be because the relevant options on the DDL Tab Options dialog have not been selected.

The following describe options that require additional explanation:

  • Enclose names in quotes/brackets: To avoid object name conflicts, you can enclose in brackets or quotations all names or enclose only names that conflict with SQL keywords. If the database platform supports object names enclosed in brackets or quotes, these options are available in the General Options section of the DDL tab Options and the DDL Generation Wizard. If you select Enclose Names That Conflict with Keywords, then any column names that contain SQL keywords will be automatically enclosed in brackets.
  • Use Complete Syntax for Virtual Columns: This option is available for Oracle 11g and later. When this option is not selected, virtual columns will be added to the DDL with the following syntax:

column [<datatype>] AS (<column_expression>)

where <datatype> is set to the data type of the column if the Show Datatype option is on for the column and is omitted otherwise, and <column_expression> is the expression stored as the virtual column expression.

When this is selected, virtual columns will be added to the DDL with the following syntax:

column [<datatype>] GENERATED ALWAYS AS (<column_expression>) VIRTUAL

  • NUMBER datatype: NUMBER or NUMBER(*) you must set the width and scale to *. A width of 0 will be converted to * when generating DDL.

Using the Object JSON tab

For MongoDB and JSON Instance, the JSON tab of the Object Editor displays the fields of the context object as well as all nested objects and their fields. If you edit a nested object, its fields and nested objects are included recursively, but none of the parent information is included. Options on the JSON tab can give you more control over the JSON created.

To customize the content of the JSON tab

  1. Double-click an object to open the Object Editor.
    JSON Tab.jpg
  2. Click the JSON tab, and then click Customize.
    JSON Tab Options.jpg

Notepad blue icon 2.pngNote: If the JSON is not displaying the options you expect to see, it may be because the relevant options on the JSON Tab Options dialog are not selected.

The following describe options that require additional explanation:

  • Quote field names selects whether you want to add quotation marks around field names.
    • Only quote field names containing means that only field names containing a period are enclosed in quotation marks.
    • Quote all field names means that all field names in the generated JSON will be contained in quotation marks.
  • Output as plain JSON means to remove all MongoDB-specific constructs when generating a database for a MongoDB model. This option removes MongoDb constructs such as ObjectId() and instead a generic JSON is generated.

See Also