Sequence Numbers.

sreenathk

New Member
Hi All,

I am developing a web page using .NET which inserts a record in the progress database.

I would want the Progress Database to automatically handle the Sequence Number generation for a primary key in a table similar to a IDENTITY COLUMN in SQL Server.

Is this possible ?

Thanks
Sreenath
 

TomBascom

Curmudgeon
You would typically use a Progress db sequence and a CREATE trigger to do this.

The "right" way to be doing this would be by way of an app-server that handles your data access layer.

If you're using .Net + SQL-92 access you may not be happy. SQL triggers are Java and 4GL triggers are 4GL -- and they do not talk to one another. You would have to make sure that bot types of triggers and created and used correctly and keep them that way. An unlikely proposition.
 

sreenathk

New Member
Well I created a sequence and used this in the insert statement and it worked !!!

INSERT INTO TABLE1 ("Column1") VALUES (PUB.""Sequence1"".nextval)

Thanks
Sreenath
 

Casper

ProgressTalk.com Moderator
Staff member
Tom is not saying that that would not work.
The point Tom is making that by creating and updating OpenEdge DB through SQL the Progress database triggers, which handle the referential integrity of the database, are not fired.
You have to write your own triggers for SQL, you have to do that in Java and you have to make sure that they are always up to date with the 4GL triggers.

And I agree, most likely this is a unlikely proposition.

Casper.
 

sreenathk

New Member
Thanks a lot guys !!!
Let me write the code in Java and see if I can make it work as you guys mentioned.
 
Top