Unfortunately, Progress does not support columns which have sequential numbers in it. In SQL Server or Oracle, you can specify a column's data type to be a
bigint
and an identity
column. For instance:CREATE TABLE dbo.Students (StudentID bigint identity(1,1),
StudentName varchar(20))
So in Progress, there isn't a such thing. Therefore, you need to set up a sequence in your database. Once you have set up your sequence, then in your code, you can do the following:
INSERT INTO pub.Students(StudentID, StudentName) VALUES (pub.sq_StudentID.NEXTVAL, 'Joe Schmoe')
The NEXTVAL
function will retrieve the next value in the database for that sequence. I assume that it keeps track of it based on the sequence. To my knowledge, any sequence that you create is not tied to any database table. It simply resides as it's own sequence and keeps track of itself.More information about the NEXTVAL function can be found on Progress' knowledge base website
No comments:
Post a Comment