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
1
vote
2 answers

How to make ID "Primary Key" Field set number based on Rows rather than AUTO_INCREMENT

Right now I have my ID field as the primary key in MySQL and have AUTO_INCREMENT on. What I want to know is how to make the ID represent the number of that row in the table rather than giving it a number when it's inserted, then sticking with that…
1
vote
3 answers

jQuery Loop? Clone? Simply WHY?

NEW VERSION (not new problem...) So, i got a "loop" problem with a .click(); and a .html();. Retrieve XML datas: OK function afficher(NomPizz, Prix1, Prix2, Prix3) {//HERE IS MY CODE//}); Print them to screen: OK $('#pricecontainer').show();…
bZezzz
  • 972
  • 9
  • 22
1
vote
2 answers

Update the ID of an Item in the SQLite database

I still can not solve the issue of update in database. My application has two lists defined in two activities. List A has positions and List B items. The data in both lists are saved to and uploaded from the database. As it could be seen from the…
user1706819
  • 125
  • 1
  • 4
  • 17
1
vote
1 answer

Is it possible to specify what I want to auto increment?

I have a cell with the format "mm/dd/yyyy hh:mm:ss". I want to auto increment the minute, but when I manually auto increment after selecting only that cell, it increments the day. To make it increment the minute, I have to manually copy the cell…
Quintis555
  • 659
  • 3
  • 11
  • 16
1
vote
3 answers

Dataset does not reflect new primary key after insert

This is my first question here and please excuse me with this presenting style. I have a MySQL table categories with following columns: c_id (auto-increment) c_code c_name Here is what I am trying to do; dataset contains one table -…
eric
  • 199
  • 2
  • 3
  • 11
1
vote
1 answer

Hidden Counter Pagination Issue

I currently have a working table that is sorted by several select boxes. I recently implemented endless/infinite scrolling by following this tutorial: http://railscasts.com/episodes/114-endless-page-revised?view=asciicast The tutorial worked after a…
1
vote
3 answers

Conditional Auto increment in xsl

I have an XML like this: 1 1 1555 1 I want to make it something like this: 0001
Gourav
1
vote
1 answer

Rails Auto-Increment Column

I asked this same question about a week ago, but I might not have been clear with what I wanted. I already have a table created that is sorted/filtered by several different select boxes. I need the first column in my table to increment, for…
jackadanos
  • 133
  • 2
  • 12
1
vote
2 answers

serial type produce only even or odd numbers in postgresql

I want set some constraint to the serial type,it only produce even or odd numbers.
yjfuk
  • 1,415
  • 4
  • 13
  • 12
1
vote
1 answer

set auto increment size to 200001 and offset 10000

I am trying to set auto_increment_increment = 200001 and auto_increment_offset = 10000 in my.cnf, but when i do show variable like '%auto%' it gives maximum increment value as 65535. Then, I created a table with auto increment value as 200001, and…
Jyotir Bhandari
  • 109
  • 1
  • 10
1
vote
1 answer

mysql auto increment and merging multiple databases into one master

We have Master Database A and clients DATABASE B and DATABASE C. Now Database A is having auto_increment = 10000 and auto_increment_offset = 10000. We want my clients DATABASE B and DATABASE C setted with auto_increment = 10001 and…
Jyotir Bhandari
  • 109
  • 1
  • 10
1
vote
1 answer

Fill Array With incremented Date value in Android

//Well i have gone through so many tutorial but coudlnt find my thing so i am here to put up my query i have two DatePicker FromDate and ToDate What i want is when User selext the date it should come in a String Array of Dates suppose my date is…
raghav chopra
  • 827
  • 3
  • 9
  • 25
1
vote
1 answer

ALTER TABLE table AUTO_INCREMENT = $x

i would to execute this query but it doesn't work and i don't know why : $query = mysqli_query($connexionUser, "ALTER TABLE creatik AUTO_INCREMENT = '$i'"); i check my vars and there are okay. Auto increment is set on a id column who is primary key…
TikTaZ
  • 670
  • 1
  • 11
  • 32
1
vote
5 answers

MySQL - Foreign key and auto-generated ID

In my application I have a component that receive objects from another components and insert them to MySQL DB. Currently I'm buffering the objects and once in a while (few seconds) the objects are inserted to the DB using a batch (using JDBC, not…
danieln
  • 4,795
  • 10
  • 42
  • 64
1
vote
2 answers

reset autoincrement when using a data adapter in c#

I'm trying to take an existing Access database file (template.mdb) as a template for a new file. I want to drop some tables' rows (but keep other tables). I "access" the table via TableAdapters generated by Visual Studio 2010 (via add item -> data…
Onur
  • 5,017
  • 5
  • 38
  • 54