활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
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.
해결되었습니다! 솔루션으로 이동.
조회 수
답글
좋아요 수
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.
조회 수
답글
좋아요 수
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
조회 수
답글
좋아요 수
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
조회 수
답글
좋아요 수
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.
조회 수
답글
좋아요 수
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.
조회 수
답글
좋아요 수