Dear Community's Leaders,
I have created custom schema but auto primary key is not incremented correctly.
schema structure: I have used auto pk true
I tried community suggestion to solve this issue through workflow using SQL code activity, still I am getting error.
SQL:
Can you please help me this.
Solved! Go to Solution.
Views
Replies
Total Likes
Hello @Sathyam999
You have shared 2 screenshots form 2 different instances.
I assume the one attached in the main thread is from production env. You are using the custom sequence where it should work. Try, removing the Key and deindex attributes. The keys are also indexed and since you are using autopk, you don't have to define the primary key.
Views
Replies
Total Likes
Hi @Sathyam999
As using the SQL script you have already assigned the first key with 0 value, hence while using insert or update activity you are getting this duplicate error. Could you try insert a record manually either by SQL script or Javascript, and then try to insert using the activity.
Regards
Akshay
Views
Replies
Total Likes
Hi @AkshayAnand ,
Thank you for your response,
when I enter the values into the schema through SQL code, data inserted correctly into the data base but primary key is not incremented properly, when I enter data manually in the form.
It is incremented randomly not sequentially like 1,30,60,90..
when I enter the data into the schema, it should be updated 1,2,3 like this, can you please tell if there is any other solution.
I have used autopk="true" in the schema
Regards
Sathyam
Views
Replies
Total Likes
Hi @Sathyam999 ,
The solution for the Incrementing gap for autopk is given in the below thread , where David had explained why there would be a gap of 30 for each Increment. Please refer to the below thread, you can replace the function used to generate the Sequence. Although there can be a risk during the bulk Inserts/Updates if there is an Increment of 1, as all the sequences should be assigned to bulk data at once.
Regards,
Pravallika.
Views
Replies
Total Likes
Hello @Sathyam999
You have shared 2 screenshots form 2 different instances.
I assume the one attached in the main thread is from production env. You are using the custom sequence where it should work. Try, removing the Key and deindex attributes. The keys are also indexed and since you are using autopk, you don't have to define the primary key.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies