cancel
Showing results for 
Search instead for 
Did you mean: 

objects generated out of order

mark_mcnary
Explorer
0 Kudos

I have noticed that the DDL generated will often have objects generated out of order, such as some (but not all) tables and views being generated before the drop database command.

Is there something I am missing in the setup or options for generation that would make objects be generated in the logical order, i.e. tablespaces before tables, no ojects in the database before dropping the database, etc..

I am running 16.1.0.3917 EBF 18.

DB is DB2 z/OS V10

Accepted Solutions (1)

Accepted Solutions (1)

former_member192453
Active Participant
0 Kudos

For the tables and views in question, check to see if the table belongs to any database.

My guess is that you are encountering the following:

A table that does not belong to any database is generated before first database.

Same for any view based on a table that does not belong to any database.

A quick repro

  1. create table_1 with several columns
  2. with table_1 selected, press ctrl+shift+v to create a view
  3. create database_1
  4. create table_2 with several columns
  5. on table_2 physical options, associate database_1
  6. with table_2 selected, press ctrl+shift+v to create a view
  7. open the Model properties and select the Preview tab

NOTE:

generation order is

  • table_1
  • view_1
  • database_1
  • table_2
  • view_2

Anthony

Answers (2)

Answers (2)

former_member186838
Active Participant
0 Kudos

Hi,

there is EBF19 available for 16.1 on Sybase download. There is a fix for 16.1 (CR 735198) fixes some generation order issues. Not sure if this one was already included in EBF 18.

HTH

Best regards

Stefan

former_member185199
Contributor
0 Kudos

I can confirm this behaivor with views created before the drop table  statement for example, this is NOT reproducable so far, sometimes it works sometimes not.

regrads

dj

mark_mcnary
Explorer
0 Kudos

My model is pretty consistent.  It generates 2 views before the drop database statement and the rest in the appropriate position.

arnaud_laurent
Employee
Employee
0 Kudos

Select Database > Edit Current DBMS.

In the DBMS property sheet, select ::Script\Objects\GenerationOrder.
Is the Database item at the very beginning of the list?

If so, have you tried to merge this PDM into a second brand new PDM with the same target DBMS (select all merge actions), and then generate SQL again using this second model?

Regards,

Arnaud

mark_mcnary
Explorer
0 Kudos

Everything in the generation order seems to be correct.  I have not tried to merge the model.

<Order>

<Metaclass Name="Database">

   <Metaclass Name="Database::Permission" />

</Metaclass>

<Metaclass Name="Storage" />

<Metaclass Name="Tablespace" />

<Metaclass Name="BusinessRule" />

<Metaclass Name="Sequence">

   <Metaclass Name="Sequence::Permission" />

</Metaclass>

<Metaclass Name="AbstractDataType">

   <Metaclass Name="AbstractDataType::Permission" />

</Metaclass>

<Metaclass Name="PhysicalDefault" />

<Metaclass Name="PhysicalDomain" />

<Metaclass Name="User" />

<Metaclass Name="Group" />

<Metaclass Name="Role" />

<Metaclass Name="Table">

   <Metaclass Name="Table::Index" />

   <Metaclass Name="Table::Key" />

   <Metaclass Name="Table::Permission" />

</Metaclass>

<Metaclass Name="View">

   <Metaclass Name="View::ViewIndex" />

   <Metaclass Name="View::Permission" />

</Metaclass>

<Metaclass Name="Reference" />

<Metaclass Name="JoinIndex" />

<Metaclass Name="Synonym">

   <Metaclass Name="Synonym::Permission" />

</Metaclass>

<Metaclass Name="Dimension" />

<Metaclass Name="Procedure">

   <Metaclass Name="Procedure::Permission" />

</Metaclass>

<Metaclass Name="DatabasePackage">

   <Metaclass Name="DatabasePackage::Permission" />

</Metaclass>

<Metaclass Name="Table::Trigger" />

<Metaclass Name="DBMSTrigger" />

<Metaclass Name="View::Trigger" />

<Metaclass Name="WebService" />

<Metaclass Name="ExtendedObject">

   <Metaclass Name="ExtendedObject" Stereotype="AuxiliaryTable" />

   <Metaclass Name="ExtendedObject" Stereotype="TrustedContext" />

   <Metaclass Name="ExtendedObject" Stereotype="Mask" />

   <Metaclass Name="ExtendedObject" Stereotype="RowPermission" />

</Metaclass>

</Order>

former_member185199
Contributor
0 Kudos

i will try this, next time i see the wrong order.
but i wonder: would it be possible to check this new PDM (after renaming it) into the repository under the old name or is it a new Object and i loose the history of changes?

mark_mcnary
Explorer
0 Kudos

I created a new model and merged the two.  Same result.  At least it's consistent in its failure.

Former Member
0 Kudos

Arnaud,

I know its been a year since you suggested the merge, but I wondered.  Why did you suggest this?  What would doing a merge do to correct the issue?  Thanks.  Jane