Book a Demo

Author Topic: Beginner: Howto create a Oracle sequence?  (Read 4423 times)

gwi2008

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Beginner: Howto create a Oracle sequence?
« on: October 28, 2008, 10:06:32 pm »
Hello,
I'm new to EA so please be patient. I'm creating a data model for Oracle and I have some ID's which should be generated by an insert trigger which uses an Oracle sequence.

Can someone give me a hint how to do this?

Another question: Is it possible to add a constraint to a table from a different data model?

Thanks for any help,
gwi

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Beginner: Howto create a Oracle sequence?
« Reply #1 on: October 29, 2008, 11:12:26 am »
For an Oracle sequence take a look in the EA help. It is indexed under Sequence | Oracle, DDL Options (and the same with for Packages appended).

I don't think you can do the constraint trick, but I'd love to be corrected on that.

David
No, you can't have it!

gwi2008

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Beginner: Howto create a Oracle sequence?
« Reply #2 on: October 29, 2008, 07:55:23 pm »
The help is not that usefull:

Quote
If generating Oracle sequences, you must always select the Generate Triggers and Generate Sequences checkboxes; this ensures that a pre-insert trigger is generated to select the next sequence value to populate the column

This is all what's in the help file. If I just click on the checkboxes and then generate the DDL then no trigger and no sequence is generated. I mean this makes sense, because how should EA know what trigger and what sequence to create?

So the question remains: How do I create an Oracle sequence and the according pre-insert trigger in a data model?

Thanks for any help,
gwi

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Beginner: Howto create a Oracle sequence?
« Reply #3 on: October 30, 2008, 12:17:06 am »
Quite right gwi. I'm sorry I misdirected you.

Looking through the documentation I can't find the right spot. Nor can I remember how I handled this in the past. It's been a long time, and I don't even remember if I had EA create the DDL for the sequences. I keep thinking there are some limitations to what EA can do in this regard, but I simply cannot remember what they are, or if they are severe.

Search the forum for this. Go back quite a while, since this does not come up too often.

David
No, you can't have it!

hd

  • EA Administrator
  • EA User
  • *****
  • Posts: 312
  • Karma: +0/-0
    • View Profile
Re: Beginner: Howto create a Oracle sequence?
« Reply #4 on: October 30, 2008, 08:14:52 am »
On the column proerties dialog, highlight the column on which you want a sequence, click the [Column Properties...] button and check the Auto Number checkbox. Then generate your DDL with the items checked as mentioned in the help.

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Beginner: Howto create a Oracle sequence?
« Reply #5 on: October 30, 2008, 09:40:59 am »
I have updated the Help to fill in this gap.

We used to have a reference to the Column Properties but it went AWOL for some reason.  I can't understand how. Anyway, it's back and doing 500 press-ups as punishment for its deriliction of duty. Apologies.
Best Regards, Roy

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Beginner: Howto create a Oracle sequence?
« Reply #6 on: October 30, 2008, 10:37:10 pm »
Thanks Roy. My Oracle work (with EA that is) went back to before your time with Sparx. I was likely referring gwi to the 'phantom' page, which neither of us could find afterward.

At least I might be able to help the next person who asks...

David
No, you can't have it!

gwi2008

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Beginner: Howto create a Oracle sequence?
« Reply #7 on: October 31, 2008, 04:58:22 am »
Quote
On the column proerties dialog, highlight the column on which you want a sequence, click the [Column Properties...] button and check the Auto Number checkbox. Then generate your DDL with the items checked as mentioned in the help.

I will try that - next week - I have the day off  8-)

Anyway - thanks for your help to all of you!
« Last Edit: October 31, 2008, 05:00:06 am by gwi2008 »