Questions tagged [auto-increment]

a database constraint that automatically increases from the last record when making an INSERT

AUTO_INCREMENT is a flag set on a field in a database table that forces the RDBMS to create a unique identifier for the record. This is useful when no other obvious primary key field is apparent in a record.

Useful questions

Related tags

2677 questions
0
votes
0 answers

How to use DirectQuery Data Connectivity Option on Microsoft Power Bi with MYSQL DB?

I downloaded the latest option of Microsoft Power Bi and I'm visualizing data from a MySQL DB, however when importing the data set into Power Bi I stopped seeing the option to pick a Data Connectivity mode after I downloaded MySQL Connector. I need…
Jaiylon
  • 67
  • 6
0
votes
0 answers

Why Auto Increment dont update

When inserting a row into my table, the auto increment value for my next insertion does not increment. Similarly in phpmyadmin I can't change this value manually. Auto Increment
NIKO
  • 1
  • 1
0
votes
1 answer

Sequelize ORM - Auto-increment function not working for new user creation in database

I use sequelize ORM. I have created a register route and controller to create new user. I created a new user with AVA test, but the auto-increment function isn't working properly. Despite being the fourth user created, this new user created with…
0
votes
1 answer

How do I auto-increment a unique version number using ActiveRecord?

I have a model License that needs to have a version number (an Integer) but I don't want that to be confused at all with the actual id. I have a field version_number. What is the simplest way to tell ActiveRecord to automatically increment it on…
Dave Sag
  • 13,266
  • 14
  • 86
  • 134
0
votes
1 answer

root - ERROR - post - 46 - Record creation failed: (1062, "Duplicate entry '23SNS0002' for key '' ")

from django.db import models from django.utils import timezone import datetime class Employee(models.Model): emp_id = models.CharField(editable=False,unique=True,max_length=10,default=None) def save(self,*args, **kwargs): if not self.emp_id: …
0
votes
1 answer

How to add an Auto Increment Primary Key to a MariaDB System Versioned Aria table

I've made a bit of a mistake and I cannot correct it. I have a table Email and I've used the email address as the Primary Key. This is a mistake and I want to add an Auto Increment ID to the table instead. However, the table is System Versioned…
İan Boddison
  • 357
  • 2
  • 11
0
votes
0 answers

Why MYSQL auto-increment doesn't work when i insert a row?

When my web application wants to insert new rows in the mysql product table, it's always the same id that is inserted. Except that this creates errors because the identifier must be unique. The auto-increment is activated in the product table, this…
NIKO
  • 1
  • 1
0
votes
0 answers

how to add a prefix with triggers in mysql?

I have the products table with id(auto_increment) and product fields. After each INSERT into the products table, I want the product name to be prefixed with the id value Using the instructions below, I manage to rename the "product" field, however,…
0
votes
0 answers

How to make an app on MIT App Inventor that can use real times and dates?

Is there a way/how can I access real satellite times and dates to utulize in, for example, a scheduling app on mit app inventor? I would really appreciate help, as there is a project that I have been working on for a while now but can’t get this to…
0
votes
3 answers

How can I import data to SQL from CSV or XLS automatically incrementing a string field based on current records in DB?

I need to import data from Excel into a SQL 2000 db. I need to import 6 fields from the worksheet and increment a string field containing an integer padded to 5 characters with leading zeros. This field is not the primary key and the db does not…
G-.
  • 1,061
  • 3
  • 11
  • 29
0
votes
0 answers

Variable Name Duplicates when Incrementing

I am trying to convert a variable name function I wrote for a smaller set of data to a larger one and have run across a problem of creating duplicate variable names because of the size of the set. I need unique variable names created in this step…
0
votes
1 answer

Database auto increment primary key with business login

I have a database with USERS table and EVENTS table, both with auto increment integer primary key called id. when the client app start an event, a message sent to the server, and the server creates a new EVENT entry in the EVENTS table with the…
Eyal
  • 10,777
  • 18
  • 78
  • 130
0
votes
0 answers

How to insert into an autogenerated column in EF?

A column in our API tables is set as follows in Entity Framework. The underlying Oracle database also has a formula for generating a number if passed "0". What does StoreGeneratedPattern mean? Since this design, there's been a request to bulk…
CDove
  • 1,940
  • 10
  • 19
0
votes
0 answers

google sheets checkbox increment counter

I am making a checkbox inventory counter that auto increments I have tried many if then statements to increase a cell value when a box or multiple boxes is check. The best I could do was display a number but it disappears once the checkboxes are…
0
votes
1 answer

Auto Generate Incrementing Number

The question I have is that I'm trying to auto-generate a number incrementally every time a user creates a new record. I'm trying to have the field auto-generate a number as soon as a person wants to create a new record and have it be uneditable or…