Why doesn't autoIncrement work?
Title.
When you add one record to the table, it should be like
x (Autoincremented) = 0
then
x = 1
But it keeps being 0
Why?
Title.
When you add one record to the table, it should be like
x (Autoincremented) = 0
then
x = 1
But it keeps being 0
Why?
You can try the below approach to make an autoincremental Key for a custom schema :-
Create a Schema with "AutoPK="true" "

Do Update Database structure by following the path -- Tools >> Advanced >> Update database structure.

Once the DB has been committed logout and login.
Now create a workflow to alter the sequence that has been automatically create at the time of DB update. (You can edit the same at the time of DB update also in the SQL window.)

In the SQL activity, insert the following code to create your custom auto incremental key by 1
drop sequence auto_cussequenceTest_seq; --(dropping the Sequence of the custom schema created at the time of DB update, you can find it in the preview tab of the schema);
create sequence auto_cussequenceTest_seq; --(Creating the Sequence for the custome schema)
alter table CusSequenceTest alter isequenceTest set default nextval('auto_cussequenceTest_seq' ); --(setting up of nextVal for incremental value)
INSERT INTO CusSequenceTest (isequenceTest ) VALUES (0); --(defining the first 0 value for the primary key, hence the records now will have sequence as 1,2,3... )
insert into CusSequenceTest( sEmail ) values ('testingAkkitest3.com'); --(Testing by inserting a record using SQL sript)
You can also test the same by inserting the record using JS.
Hope this might help.
Regards
Akshay
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.