I'm doing data modeling using EA 12 against the PostgreSQL DB platform. I've created a view in the model using the Database Builder. The view definition contains the SELECT statement for the view. When I generate the DDL for this view to the DDL Execution Engine, the view doesn't get created - instead the generation script contains only the SELECT statement, instead of "CREATE VIEW <name> AS..." and the select statement.
Looking at the DDL Create View Template for PostgreSQL in the template editor, it seems that the template does *not* provide the CREATE VIEW statement. I could modify the view definition titself to include "CREATE VIEW <name> AS" which would be easy, but if the name of the view changed I'd have to change it in the code, and that's what template generators are for! So, I modified the DDL Create View template to include "CREATE VIEW $viewName AS" before the $viewDefinition line and saved the template. However, when I then generated the view, it still generated *only* the SELECT statement. It seemed to be ignoring my updated template, which seems like a bug to me, or possibly I'm not doing something like linking the modified template to the "create view" action for the code generation engine.
Any input would be appreciated as I have many views to write and don't want to have to manage their names within the view definitions should they change.
Here's the modified DDL Create View template code:
%if ddlOptionGenerateView != "T"%
%endTemplate%
$viewName = %DDLName("EA", "VIEW", "INCLUDE_OWNER", "INCLUDE_SURROUND")%
$viewNameSS = %DDLName("EA", "VIEW", "INCLUDE_OWNER")%
$viewDefinition=%viewProperty:"DEFINITION"%
%EXECUTE_STRING($viewNameSS, "Create View", 530, $viewDefinition)%
CREATE VIEW $viewName AS
$viewDefinition
%PI("I", "")%
%DDLScriptSeparator%
%PI("I", "\n")%
%DDLTableLevelComment("VIEW")%