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
5 answers

PHP variable question

here is my code echo ("
"); if ($APIkbpersec < 30) { global $SpeedTest; echo ("Slow speed"); $SpeedTest--; } if ($APIkbpersec > 30) { global $SpeedTest; echo ("High speed"); $SpeedTest++; } echo $SpeedTest; the page this…
Jason Russell
  • 1,234
  • 3
  • 15
  • 27
0
votes
0 answers

How to create a auto-increment column in PostgreSQL

I want to create auto-increment column in the form 'YYYYMMDD-xxxxx'. 'YYYYMMDD' is the date the data was inserted. 'xxxxx' is a value that auto increases by 1. Is this possible? could you tell me…
eloiz
  • 81
  • 9
0
votes
1 answer

Oracle 9i auto increment trigger/sequence doesnt work

The following SQL, upon being executed on an Oracle 9i server, yields the the error " ORA-04098: trigger 'DBO.WTF_TRIGGER' is invalid and failed re-validation". DROP TABLE "DBO".WTF; CREATE TABLE "DBO".WTF (id NUMBER PRIMARY KEY, name…
Jason
  • 211
  • 5
  • 10
0
votes
2 answers

How to automatically detect a column with an auto-incrementing data type in Firebird?

Is it possible to find out if a Firebird table has an auto-increment column?
sid_com
  • 24,137
  • 26
  • 96
  • 187
0
votes
1 answer

C# model binding with auto increment column

I got below model and i would like to create List when its instantiated. My question is is there a way i pass only Col1 and Col2 and rowID gets generated automatically, like autoincrement. Please note, this is not any DB related operation to use…
Ramu
  • 343
  • 1
  • 6
  • 21
0
votes
3 answers

Change the auto increment amout in a foreach loop

Is there a way to make a foreach loop increment by more than one? I am loading a jquery script before each item in a foreach loop and I want the delay to increase by 300 for each item, so that each item animates separately as opposed to at the same…
Ryan Sherman
  • 57
  • 1
  • 8
0
votes
0 answers

EclipseLink @GeneratedValue(strategy = GenerationType.AUTO creates already exist id

I am developping a java application with postgresql database, I made a manual insert into a table, and now when i try to insert from the application I get the following error: Detail: Key (id)=(1092770) already exists I am using eclipseLink as JPA…
rainman
  • 2,551
  • 6
  • 29
  • 43
0
votes
1 answer

Suppress Autoincrement during FasterCSV Load

I'm trying to export and import two related models using FasterCSV. The first model is Task and the second model is PrecedingTask. Task has many preceding_tasks. As you would expect, PrecedingTask references Task using the task_id field. However,…
Kevin
  • 744
  • 2
  • 7
  • 17
0
votes
1 answer

Understanding MySQLs behaviour when adding a autoincremented primary key afterwards

Let's say we have a (InnoDB) table associations in a MySQL-Database which has the following structure: CREATE TABLE `associations` ( `id` int(11) NOT NULL AUTO_INCREMENT, `fk_id_1` int(11) NOT NULL, `fk_id_2` int(11) NOT NULL, `fk_id_3`…
Aufwind
  • 25,310
  • 38
  • 109
  • 154
0
votes
3 answers

phpMyAdmin - autoincrementing ID

Quick question regarding phpMyAdmin and autoincrementing. If I add a product and it is assigned id 1, then I delete it before adding another, the next one is given the id 2 even though I deleted id 1. I hope this makes sense. Does this matter?
RapsFan1981
  • 1,177
  • 3
  • 21
  • 61
0
votes
2 answers

Can't create int-autoincrement primary key on sqlite using EF Core

I'm trying to create a simple table where the primary key is an autoincrementing integer. So what I did is, create that .NET class and tried to create the migration. this is the class-entity: public class PasswordEntry : IEntity { [Key] …
Matthias Burger
  • 5,549
  • 7
  • 49
  • 94
0
votes
1 answer

How I can use an auto increment in java for a register system?

I'm creating a register system for students using files, while I use the program the auto increment works fine, but when I ruin it again, the autoincremnt returns 1, also I am not allowed to use MySQL DataBase I initialize it in the principal…
Web777Ms
  • 3
  • 2
0
votes
0 answers

auto filling varchar column in MySQL

StudentID Name stu001 Ann stu002 James I want to create a table with auto filling StudentID column (it's a varchar column). I found various methods to use identity in SQL Server. but I couldn't find anything similar in MySQL. can I do…
0
votes
2 answers

JHipster 7: Database errors: Duplicate ID entry error

Recently, a JHipster 7.7.0 application started generating server side/database errors for ALL tables. The application was deployed in production, and users entered data without problem. Suppose there is an entity called 'Product', and users have…
Mike Smith
  • 238
  • 3
  • 14
0
votes
0 answers

Exclude AUTO_INCREMENT column value while using Entity framework Clone SetValues methods

I am using below code to clone records from one table to another using Entity Framework List _records = context.MasterTableRecords .Where(c => ......).ToList(); _records?.ForEach(record…
1 2 3
99
100