Author Topic: Problem generating database views  (Read 1219 times)

craige

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Problem generating database views
« on: April 27, 2007, 01:07:54 am »
I am currently trying to model a database view but I am not having much success.  

Having read through the documentation, I have done as suggested and setup a view stereotype. Unfortunately when I get round to generating the DDL, despite what I entered into the text area labeled View Definition,  nothing that I have entered into this text box appears within the DDL which is subsequently generated. I am probably doing something incorrectly but I cannot from the documentation work out exactly what I am doing wrong. Has anybody any suggestions?

The text which I am entering into the view definition box is as follows :

CREATE VIEW faultView AS SELECT * FROM site WHERE id  = 'hello'

I have ensured that when I generate the DDL, I have ticked the tick box associated with the generation of code related to views.

My database is postgres

Many thanks

Craige




« Last Edit: April 27, 2007, 04:24:36 am by craige »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Problem generating database views
« Reply #1 on: April 27, 2007, 04:25:45 am »
What is your target DBMS? I think views are only created for Oracle and SQL Server.
No, you can't have it!

craige

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Problem generating database views
« Reply #2 on: May 07, 2007, 12:06:37 am »
The database is postgres.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Problem generating database views
« Reply #3 on: May 07, 2007, 02:00:39 am »
Which you stated in the original message, but I somehow missed - sorry...

From some time ago I remember that Sparx answered that Views are only supported in SQL Server and Oracle - at least in the current version (6.5, build 806 as I write this).

[I just checked the build 806 help file. At the top of the Data Modeling | Views page it states:
Quote
Note: Views are currently supported only for SQL Server, Oracle 9i and 10g and Sybase Adaptive Server Enterprise.

Perhaps this will change in the upcoming 7.0, but only Sparx can shed light on that.

David
No, you can't have it!

craige

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Problem generating database views
« Reply #4 on: May 07, 2007, 02:12:40 am »
Thanks for your help. I have contacted Sparx directly about this to see if they plan to do something about it.

At the moment I have changed the designated database inside of EA for the view tables to Oracle (which results in EA producing code very similar to postgres) and then postprocess the EA-generated DDL using perl to get it into the correct form such that I can then use it to create the database inside of postgres. Hardly ideal but I have too much invested in my data model inside of EA to abandon it now.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Problem generating database views
« Reply #5 on: May 07, 2007, 03:51:14 am »
So at least you have a solution for now Craige,

Actually, if you are a whiz at Perl or XSLT (or something else that handles text conversions) then this will likely serve you very well.

You could also handle (more gracefully) the foreign key naming issues with Postgres and EA default naming conventions.

David
No, you can't have it!