View and Routine Configuration
Who this is for
For users who need to generate view DDL or stored procedure, function, and trigger skeleton code in addition to table creation statements.
What this solves
You can complete table, view, and routine skeleton design in the same tool, reducing the cost of switching between multiple tools.
Prerequisites
- The view query or routine type to be created is already identified.
- The current database type supports the corresponding syntax (most databases support views; routine support varies by database).
Steps
View Configuration
- Find the
View Definitionpanel in the table configuration area (usually below table config or in an independent tab). Result: the view editor opens. - Fill in
View Nameand theSELECTquery. Result: the system saves the view definition. - For field aliases, explicitly use
ASin the SELECT. Result: aliases appear in the generatedCREATE VIEWcolumn list. - Switch to the
Viewtab in the right output area. Result: the system generates the corresponding database'sCREATE VIEWstatement. - Click
Copy View DDL. Result: the statement is copied to clipboard.
Routine Templates
- Find
Routine Templatesin the table configuration area orMisc Settings. Result: the template selector opens. - Select the type:
Stored Procedure,Function, orTrigger. Result: the system loads the corresponding skeleton template. - Adjust parameter names, return types, or trigger timing in the template as needed. Result: template personalization is complete.
- Switch to the
Routinetab in the right output area. Result: the system generates a completeCREATE PROCEDURE/CREATE FUNCTION/CREATE TRIGGERskeleton. - Click
Copy Routine. Result: code is copied to clipboard, ready to continue filling business logic in the database client.
Done when
- View DDL or Routine code has been successfully copied.
- Syntax matches the target database dialect.
- The view query can execute correctly on the target database (secondary verification in database client is recommended).
Common pitfalls
- If the SELECT query in a view references non-existent tables or fields, the generated DDL is syntactically correct but will fail on execution.
- Trigger
BEFORE/AFTERcombined withINSERT/UPDATE/DELETEmust match the target database's supported range. - Routine templates only generate skeleton code; business logic requires manual supplementation.
- Routine syntax varies greatly across databases (e.g., Oracle PL/SQL vs SQL Server T-SQL); recheck generated results after switching database types.