# Primari Key problem

**URL:** <https://forum.servoy.com/t/primari-key-problem/185>\
**Category:** Classic Servoy\
**Created:** [July 9, 2003, 7:01am UTC](https://forum.servoy.com/t/primari-key-problem/185 "2003-07-09T07:01:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Riccardino](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Riccardino](https://forum.servoy.com/u/Riccardino)\
**Post date:** [July 9, 2003, 7:01am UTC](https://forum.servoy.com/t/primari-key-problem/185/1 "2003-07-09T07:01:37Z")

</div>

Hi,

I installed 1.1 rc4, I created a connection to a db server (MySQL) I was using with 1.01 and I put all the fields in a form.  
When I create a new record, the primary key on the server is not updated and remains empty (even if the field doesn’t allow null values).

Even stranger, if I import from 1.01 a solution based on the same backend, the primary key works fine.

---

<div class="post-metadata">

**Author:** ![Jan\_Aleman](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jan\_Aleman](https://forum.servoy.com/u/Jan_Aleman)\
**Post date:** [July 9, 2003, 2:56pm UTC](https://forum.servoy.com/t/primari-key-problem/185/2 "2003-07-09T14:56:22Z")

</div>

Can you check if there is a servoy sequence on that primary key field?

---

<div class="post-metadata">

**Author:** ![Jan\_Aleman](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jan\_Aleman](https://forum.servoy.com/u/Jan_Aleman)\
**Post date:** [July 9, 2003, 3:08pm UTC](https://forum.servoy.com/t/primari-key-problem/185/3 "2003-07-09T15:08:42Z")

</div>

I forgot to mention that we don’t have any troubles with mysql.

---

<div class="post-metadata">

**Author:** ![Riccardino](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Riccardino](https://forum.servoy.com/u/Riccardino)\
**Post date:** [July 12, 2003, 9:56am UTC](https://forum.servoy.com/t/primari-key-problem/185/4 "2003-07-12T09:56:05Z")

</div>

> jaleman:  
> Can you check if there is a servoy sequence on that primary key field?

There was a sequence, but it didn’t work. So, I set it to “none”, but the records were created empty (I thought that “none” meant that the sequence was managed directly from mysql and not from Servoy).  
Today, I set again a servoy sequence and it works.

![:)]( "Smile")

But I’m curious about one thing: if I wanted to be MySQL to take care of the sequence, how should I do (if it’s possible, of course)?

Thanks

---

<div class="post-metadata">

**Author:** ![Jan\_Aleman](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jan\_Aleman](https://forum.servoy.com/u/Jan_Aleman)\
**Post date:** [July 12, 2003, 4:47pm UTC](https://forum.servoy.com/t/primari-key-problem/185/5 "2003-07-12T16:47:27Z")

</div>

You can have mysql handle the sequence, but in the current version not on the primary key. We are doing some major work on making database specif sequence support, this functionality won’t make it into 1.1 but in the release after 1.1

To have a sequence handled by the database click on the Value pulldown in the column properties and choose the ‘managed by database’ option.
