1
votes

I have a table in progress db. (read: NOT POSTGRES). it has three columns, and I would like one of the column to be auto increment begins at 1 and increment by 1. Tried the following syntax but it does not see to be working.

create sequence pub.Customer_sequence
  start with 1, 
  increment by 1,
  nocycle;

the error message says:

Unable to understand after "Customer_sequence"

could not understand line 2

enter image description here

2

2 Answers

3
votes

Progress is not SQL. Some small amount of SQL-89 is included but it is not generally considered useful.

There is nothing in Progress equivalent to an auto-increment field. To get that functionality you might use a combination of CREATE trigger and a SEQUENCE.

You can find an example of a create trigger that uses a sequence in $DLC/sports/crcust.p:

TRIGGER PROCEDURE FOR Create OF Customer.

/* Automatically Increment Customer Number using Next-Cust-Num Sequence */

ASSIGN Customer.Cust-Num = NEXT-VALUE(Next-Cust-Num).
0
votes

A sequence is perhaps the closest you will get.

Look in the Data Dictionary. You will find it under the Tools menu.

There you have the "Sequence Editor" in the Schema Menu. That might be a good place to start.

enter image description here