What is the most practical, automated way to generate a header comment with model information such as title, author, model version, db version, create and last modification date in an Erwin generated ddl script taken from the physical or better logical model. Nice would be having the same information in a "MODELINFO" sql table as ddl, additionally to the header.
Creating a header with custom model information in erwin generated ddl
208 Views Asked by matz3 At
1
There are 1 best solutions below
Related Questions in SQL
- SQL schema for a fill-in-the-blank exercise
- Hibernate: JOIN inheritance question - why the need for two left joins
- What's supposed to be the problem in this query?
- Compare fields in two tables
- How to change woocomerce or full wordpress currency with value from USD to AUD
- Dynamic query creation with Array like implementation
- SQL query to get student enrolled in this month in a course - Moodle
- SQL LAG() function returning 0 for every row despite available previous rows
- Convert C# DateTime.Ticks to Bigquery DateTime Format
- Use row values from another table to select them as columns and establish relations between them (pivot table)
- SQL: Generate combination table based on source and destination column from same table
- how to use system's environnement variables in sql script
- PHP fetchAll on JOIN
- Multitable joining in Sql
- How to display name starting from 'z' by using BETWEEN cmd only?
Related Questions in DDL
- I have to write an SQL statement to create a table skill using DDL commands. the field description can be NULL and the default value is NULL
- who writes a DDL - DBA or the developer using the table
- How do you get a ddl into postgres
- truncate function doesnt work in postgres
- Can Hibernate Schema generation be used to generate DDL without database connection
- Create Table - Time Statement
- Is it possible to convert datatype when alter the table with check constraint in postgresql
- Cannot add foreign key constraint mysql
- MySQL transactions with schema modification statements (DDL)?
- Django - is it possible to avoid/minimize use of migrations?
- switching jpa 2.1 schema generation per maven profile
- Error in MySQL on create statement
- Check constraint with condition
- How to create/drop a database on DB2 through JDBC?
- change column definition in existing table
Related Questions in ERWIN
- Erwin API question adding relationships to model
- Is there a way to clone an entity in erwin?
- Why is erwin raising warning ESX-32720 and adding a suffix of "__2" to the name of my new attribute?
- Auto populate ETL columns in PDM diagram while converting from LDM to PDM
- Importing a SQL file created through Python into Erwin Data Modeler
- Why the same nsm file(Naming Stardard file) can translate words to Abbrivations in one erwin file, but it doesn't work for another erwin file?
- Unable to remove index in SQL Server
- Salesforce datamodel from Erwin DDL
- Creating a header with custom model information in erwin generated ddl
- Erwin data modeler 2020 R1 copy definitions from another database's template
- how do i solve this Violation of Primary Key constraint error? it occurs whenever I attempt execute to insert into statement more than once
- Ways to documment ETL job
- HAPI FHIR - Data Model - Entity Relationship, does anyone have a link to an ERD model that is based on FHIR
- ERD files from Common Data Model - how to open? Erwin / PowerDesigner?
- How to list the libraries and models in Model Mart through the API?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
@matz3. It sounds like you are talking about defining what erwin documentation calls "Pre and Post Scripts."
There are several ways to do this in erwin Data Modeler depending on which version you are using. In my enterprise, we're on version 2021 R1; YMMV. We use pre- and post-scripts to place Liquibase changeset wrappers (which are formatted as SQL comments) around each table create or drop, as well as to enforce certain patterns for object creation/drop order.
Macros can be used to reference various OOTB attribute values throughout the model such as those you've mentioned and pull those into comments in your "forward engineered" generated DDL.
For attributes not already available within properties of the various levels of object hierarchy (Model, Subject Area, Schema, Table, Column, Relationship, Index, etc.), you can either use the Extended Notes (not available on all objects) to create some custom attributes, or you can create User Defined Properties (UDPs, again, not available for all objects/classes).
Once you've built the attributes and assigned values or located the macros for the values you want to include in your DDL comment, you will either invoke the Template Editor (Actions > Forward Engineer > Templates) to modify the TLX scripts in the backend of erwin which build the DDL, or the Script Template Editor (Model > Script Templates), which I prefer for greater visibility to users of the model.
With Script Templates, you define Type (Model Level or Table Level) and Generate As (Pre-Creation or Post-Creation). Within the Code tab, you can invoke the Macro Toolbox to access all the pre-configured macros to reference object properties elsewhere in the model.
Once you've built all of this out the way you want it, you can save this model as a Template in your erwin Mart repository and then built all future models from that template with these built-in pre- / post-script features.
This guide goes into detail about how to use erwin's TLX scripting language. TLX is considered an advanced feature for an experienced user of erwin DM, something to pursue if you can't get what you need from the Script Template editor GUI.
I'm not certain about the last part of your question concerning MODELINFO table; are you referencing a table in the backend erwin Mart repository database, or a table that you update in your target database? For the 2nd case, you can likely use TLX to generate an INSERT statement which references the pre-script text string.