{"id":2458,"date":"2019-03-25T17:39:40","date_gmt":"2019-03-25T20:39:40","guid":{"rendered":"http:\/\/xexeu.elipse.com.br\/pt\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/"},"modified":"2023-03-07T17:10:29","modified_gmt":"2023-03-07T20:10:29","slug":"kb38947-creating-a-historic-field-that-automatically-increments-its-value","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/","title":{"rendered":"KB-38947: Creating a Historic field that automatically increments its value"},"content":{"rendered":"<div align=\"justify\"><span style=\"font-weight: bold;\">Question:<\/span><\/p>\n<p>How can I create a Historic field that automatically increments its value, so that when there is a new record, it receives a sequential value?<\/p>\n<p><span style=\"font-weight: bold;\">Solution:<\/span><\/p>\n<p>It is not possible to create this type of field in E3 Historics. However, you can create this field directly in the Database.<\/p><\/div>\n<p>&nbsp;<\/p>\n<div align=\"justify\"><span style=\"font-weight: bold;\">ACCESS<\/span><br \/>\n<span style=\"font-weight: bold;\">\u00a0 <\/span><br \/>\nWhen using Access, you can add a field to the current table, as in the example below:<\/div>\n<p>&nbsp;<\/p>\n<div align=\"center\">\u00a0<img loading=\"lazy\" title=\"\" src=\"https:\/\/kb.elipse.com.br\/en-us\/images\/ID4055\/figAccess.JPG\" alt=\"\" width=\"565\" height=\"442\" align=\"bottom\" border=\"0\" \/><\/div>\n<p><span style=\"font-weight: bold;\">\u00a0<\/span><\/p>\n<div align=\"justify\"><span style=\"font-weight: bold;\">SQL SERVER<\/span><\/p>\n<p>When using SQL Server, you can choose between two possibilities.<\/p>\n<p>Via SQL Manager, create a field, access its properties, and set them up as <b>Identity Column<\/b>.<\/div>\n<p>&nbsp;<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID4057\/2.png\" alt=\"\" width=\"409\" height=\"152\" align=\"Baseline\" border=\"0\" \/><\/p>\n<p><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID4057\/3.png\" alt=\"\" width=\"394\" height=\"307\" align=\"Baseline\" border=\"0\" \/><\/p>\n<p><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID4057\/4.png\" alt=\"\" width=\"500\" height=\"237\" align=\"Baseline\" border=\"0\" \/><\/div>\n<p>&nbsp;<\/p>\n<div align=\"justify\"><b>NOTE<\/b>: this new field must <u>necessarily<\/u> be an Integer.<\/p>\n<p>The other possibility, which also happens via SQL Manager, is to create the whole table via a Query, as seen in the example below:<\/p><\/div>\n<p>&nbsp;<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"https:\/\/kb.elipse.com.br\/en-us\/images\/ID4057\/increment.jpg\" alt=\"\" width=\"434\" height=\"171\" align=\"bottom\" border=\"0\" \/><\/div>\n<p><b>ORACLE:<\/b><\/p>\n<p>When using Oracle, you must create a trigger that increments the desired column at every new record.<\/p>\n<p>In the example below, a new column called <i>Column_ID<\/i> is inserted into <b>TestTable<\/b>, and then the trigger is created:<\/p>\n<p><span style=\"font-family: Courier New;\"><br \/>\nALTER TABLE<br \/>\nTESTTABLE<br \/>\nADD<br \/>\nColumn_ID number primary key;<\/p>\n<p>create sequence seq_autonumber;<\/p>\n<p>create trigger trg_autonumber<br \/>\nbefore insert on TESTTABLE<br \/>\nfor each row<br \/>\nbegin<br \/>\nselect seq_autonumber.nextval into :new.Column_ID from dual;<br \/>\nend;<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question: How can I create a Historic field that automatically increments its value, so that when there is a new record, it receives a sequential value? Solution: It is not&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[735],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>KB-38947: Creating a Historic field that automatically increments its value - Elipse Knowledgebase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"KB-38947: Creating a Historic field that automatically increments its value\" \/>\n<meta property=\"og:description\" content=\"Question: How can I create a Historic field that automatically increments its value, so that when there is a new record, it receives a sequential value? Solution: It is not&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-25T20:39:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-07T20:10:29+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/kb.elipse.com.br\/en-us\/images\/ID4055\/figAccess.JPG\" \/>\n<meta name=\"author\" content=\"Elipse Software\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Elipse Software\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/\"},\"author\":{\"name\":\"Elipse Software\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87\"},\"headline\":\"KB-38947: Creating a Historic field that automatically increments its value\",\"datePublished\":\"2019-03-25T20:39:40+00:00\",\"dateModified\":\"2023-03-07T20:10:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/\"},\"wordCount\":220,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"articleSection\":[\"DataBases\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/\",\"url\":\"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/\",\"name\":\"[:pt]KB-38947: Creating a Historic field that automatically increments its value[:] - Elipse Knowledgebase\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2019-03-25T20:39:40+00:00\",\"dateModified\":\"2023-03-07T20:10:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"KB-38947: Creating a Historic field that automatically increments its value\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87\",\"name\":\"Elipse Software\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g\",\"caption\":\"Elipse Software\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/webmasterelipse-com-br\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"KB-38947: Creating a Historic field that automatically increments its value - Elipse Knowledgebase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/","og_locale":"en_US","og_type":"article","og_title":"[:pt]KB-38947: Creating a Historic field that automatically increments its value[:] - Elipse Knowledgebase","og_description":"Question: How can I create a Historic field that automatically increments its value, so that when there is a new record, it receives a sequential value? Solution: It is not&hellip;","og_url":"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2019-03-25T20:39:40+00:00","article_modified_time":"2023-03-07T20:10:29+00:00","og_image":[{"url":"http:\/\/kb.elipse.com.br\/en-us\/images\/ID4055\/figAccess.JPG"}],"author":"Elipse Software","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Elipse Software","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/"},"author":{"name":"Elipse Software","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87"},"headline":"KB-38947: Creating a Historic field that automatically increments its value","datePublished":"2019-03-25T20:39:40+00:00","dateModified":"2023-03-07T20:10:29+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/"},"wordCount":220,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"articleSection":["DataBases"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/","url":"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/","name":"[:pt]KB-38947: Creating a Historic field that automatically increments its value[:] - Elipse Knowledgebase","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2019-03-25T20:39:40+00:00","dateModified":"2023-03-07T20:10:29+00:00","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/kb38947-creating-a-historic-field-that-automatically-increments-its-value\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"KB-38947: Creating a Historic field that automatically increments its value"}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87","name":"Elipse Software","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g","caption":"Elipse Software"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/webmasterelipse-com-br\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/2458"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=2458"}],"version-history":[{"count":1,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/2458\/revisions"}],"predecessor-version":[{"id":14326,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/2458\/revisions\/14326"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=2458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=2458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=2458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}