<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.contentpasted0, li.contentpasted0, div.contentpasted0
        {mso-style-name:contentpasted0;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-IE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi Riccardo,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Have you tried, after you delete your rows, disabling editing and then enabling editing again before you add your new rows?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Also have a look at this
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><a href="https://gis.stackexchange.com/questions/132346/is-there-a-way-of-auto-increment-for-the-id-column-in-qgis">https://gis.stackexchange.com/questions/132346/is-there-a-way-of-auto-increment-for-the-id-column-in-qgis</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><br>
Richard.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<table style="FONT-SIZE: 9pt; HEIGHT: 321px; FONT-FAMILY: Arial, sans-serif; WIDTH: 500px; LINE-HEIGHT: 15px" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="FONT-SIZE: 9pt; FONT-FAMILY: Arial,sans-serif; WIDTH: 500px; COLOR: #004d44; PADDING-BOTTOM: 6px">
<span style="FONT-FAMILY: Arial, sans-serif; FONT-WEIGHT: bold; COLOR: #004d44"><br>
——</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; FONT-WEIGHT: bold; COLOR: #004d44">Richard McDonnell MSc GIS, FME Certified Professional</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #004d44"><i>FRM Data Management</i></span><br>
<br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #004d44">——</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; FONT-WEIGHT: bold; COLOR: #004d44">Oifig na nOibreacha Poiblí</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #004d44">Office of Public Works</span><br>
<br>
<span style="FONT-FAMILY: Arial, sans-serif; FONT-WEIGHT: bold; COLOR: #565148">Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #565148">Jonathan Swift Street, Trim, Co Meath, C15 NX36</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #565148">——</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #565148">M +353 87 688 5964 T +353 46 942 2409</span><br>
<a href="https://gov.ie/opw">https://gov.ie/opw</a><br>
<br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #004d44">——<br>
To send me files larger than 30MB, please use the link below https://filetransfer.opw.ie/filedrop/richard.mcdonnell@opw.ie<br>
</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #004d44">Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/
</span></td>
</tr>
</tbody>
</table>
<table style="FONT-SIZE: 9pt; FONT-FAMILY: Arial, sans-serif; WIDTH: 420px; LINE-HEIGHT: 15px" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="FONT-SIZE: 9pt; FONT-FAMILY: Arial,sans-serif; WIDTH: 420px; COLOR: #004d44; PADDING-BOTTOM: 6px">
<span style="FONT-FAMILY: Arial, sans-serif; FONT-WEIGHT: bold; COLOR: #004d44"><br>
——</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; FONT-WEIGHT: bold; COLOR: #004d44">MSc GIS, FME Certified Professional</span><br>
<br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #004d44">——</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; FONT-WEIGHT: bold; COLOR: #004d44">Oifig na nOibreacha Poiblí</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #004d44">Office of Public Works</span><br>
<br>
<span style="FONT-FAMILY: Arial, sans-serif; FONT-WEIGHT: bold; COLOR: #565148">Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #565148">Jonathan Swift Street, Trim, Co Meath, C15 NX36</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #565148">——</span><br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #565148">M +353 87 688 5964 T +353 46 942 2409</span><br>
<font color="#565148"><a href="https://www.opw.ie">https://https://gov.ie/opw</a></font><br>
<br>
<span style="FONT-FAMILY: Arial, sans-serif; COLOR: #004d44">——<br>
</span><span style="FONT-FAMILY: Arial, sans-serif; COLOR: #004d44">Email Disclaimer:
<a href="https://www.opw.ie/en/disclaimer/">https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/</a></span>
</td>
</tr>
</tbody>
</table>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> QGIS-User <qgis-user-bounces@lists.osgeo.org>
<b>On Behalf Of </b>Riccardo via QGIS-User<br>
<b>Sent:</b> 02 May 2023 16:28<br>
<b>To:</b> Riccardo via QGIS-User <qgis-user@lists.osgeo.org><br>
<b>Subject:</b> [Qgis-user] Autogeneration id codes<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black">Good morning to all,<o:p></o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black">first I would like to thank Bernhard Ströbl, Richard McDonnell, Andrea Giudiceandrea and Bernd Vogelgesang for suggestions related to some of my previous posts.<o:p></o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black">Now I have another problem.....<o:p></o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black">I have some tables already created that have a column with autogeneration id codes.<o:p></o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black">From self-generation I often don’t get codes that start from 1 onwards but start with other numbers.<o:p></o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black">I made some tests and I noticed that if I create a table and add 10 lines the autogeneration creates id codes from 1 to 10. If I delete these lines to empty the table when
 I create a new line Qgis autogenerates that with the code 11, it seems that Qgis keeps in memory the number/id code of the created elements, and keep the numbering as a fixed counter.<o:p></o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black">How can I impose a autogeneration of id codes starting from 1?<o:p></o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black">Many many thanks!<o:p></o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black">Best Regards.<o:p></o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="contentpasted0"><span style="font-family:"Calibri",sans-serif;color:black">Riccardo.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
</div>
</div>
</body>
</html>