2,686 questions
0
votes
2
answers
101
views
Sheets Arrayformula: increment range size row by row
I am doing a tiny home store overview lists. At the movement sheet I want to sum ONLY the same and previous rows but never mix the results with the future row values.
As I use mostly ARRAYFORMULAs I ...
0
votes
0
answers
89
views
After export/import a table the Before Insert trigger, to increment the primary key value, does not work
I have a table 'weekrit' that has a primary key, that consists of a 'startdatum' (date value that is the first day of the week) and a 'ritid' (a number starting with 1 every week) I use a BEFORE ...
0
votes
0
answers
28
views
How to handle auto-increment gaps in OceanBase MySQL mode when bulk inserting
Environments
OceanBase Community 4.2.1 (MySQL mode)
MySQL version 5.7
We're migrating from MySQL 5.7 to OceanBase 4.2.1 (MySQL compatibility mode) and observing different auto-increment behaviors ...
0
votes
1
answer
45
views
Increasing a Batch Routine Number by Timestamp in SAS
I have a routine in SAS that runs intraday, periodically updating data in table A. I would like to identify the batch of data by the timestamp column and increment it with each data update throughout ...
0
votes
2
answers
165
views
Can't Create Hybrid Table in Snowflake
I'm trying to create a hybrid table in Snowflake using the following syntax:
CREATE HYBRID TABLE FOO
(
ID NUMBER(10,0) PRIMARY KEY NOT NULL AUTOINCREMENT START 1 INCREMENT 1,
NAME VARCHAR(8) ...
1
vote
1
answer
40
views
Make SQLite generate unique values of ROWID
I have table orders in an SQLite database:
CREATE TABLE orders
(
clientId INTEGER NOT NULL,
listId INTEGER,
exchangeId NOT NULL,
marketId NOT NULL,
id INTEGER NOT NULL,
...
1
vote
0
answers
152
views
How to add an auto increment field to an existing table with TypeORM
This SQL satatement works, and is what I’m trying to generate:
ALTER TABLE `some_entity`
ADD `generatedNumber` INT NOT NULL AUTO_INCREMENT,
ADD UNIQUE (`generatedNumber`);
However I need to do this ...
0
votes
0
answers
56
views
App fails when trying to retrieve ID auto increment Android
I am trying to get the last added or inserted record in the sqlite database/table based on the auto increment "id" Integer, but my app keeps crashing.
Here is my Kotlin code.
@SuppressLint(&...
0
votes
2
answers
194
views
Entity's primary key not being updated after changes are saved
I have a DDD setup in C#, linking entities to DB tables. An entity has a configured Id (primary key) that encapsulates a non-negative, non-zero integer (a value object). I have the primary key ...
1
vote
1
answer
45
views
Will modifying the primary key type using ALTER in MySQL reset the auto-increment value to 0?
version=5.7.32-log
i use mysql statement like these to test.
CREATE TABLE test_table (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255)
);
INSERT
INTO
...
1
vote
1
answer
171
views
inject id into JPA entity for unit testing
With Spring Boot 3 JPA (Kotlin), I have an entity with an id property that is auto-generated. Now I have code which converts such an entity to a DTO (and the id is important in that context). How can ...
-3
votes
1
answer
166
views
How to make `id` automatically set by a query instead of `AUTO_INCREMENT` [duplicate]
I have multiple tables for different kinds of objects. However, the ID of every object must be unique not only among objects of the same type but also across all objects of different types. In other ...
1
vote
1
answer
68
views
NotNullViolation Error When Inserting Data into PostgreSQL Table with Non-Nullable ID Column
I'm working on inserting data from a Pandas DataFrame into a PostgreSQL table using Python. The table structure is as follows:
CREATE TABLE sales (
id BIGINT NOT NULL, -- Primary Key
tahun ...
0
votes
1
answer
71
views
How to generate unique grouped autoincrement document id's? [duplicate]
I need to make some tables which are able to auto-increment unique document names for each month of the year based on the date of each documnet type. I think it will be a good idea to make it as a ...
-2
votes
1
answer
135
views
Key isn't auto-incrementing
I have a view model class setup like this:
using System.ComponentModel.DataAnnotations;
namespace Proj1.Models
{
public class Groups
{
[Key]
public int Id { get; set; }
...
1
vote
2
answers
77
views
Add 1 to number from cell in last row of sheet in other workbook and enter on sheet in currently open workbook
I have a "My Quote" template workbook which has a quote number in cell "I1" of the "Quote" sheet.
Upon opening that workbook I want to go to another (unopened) "...
0
votes
1
answer
419
views
How can i implement a auto Increment pk in a interative grid
I tried to implement an auto increment on my default interactive grid page by following several tutorials on YouTube, but each tutorial taught differently and none solved my problem,
the new line is ...
0
votes
1
answer
47
views
C# - Adjust an auto-incremented field of an object when item is removed from Bindinglist
I have a class for a "Car" object which I have added several instances of to a Bindinglist attached to a Datagridview. I am trying to make a specific field of this object increment every ...
0
votes
2
answers
322
views
Autoincremental values for multiple columns in snowflake
is there a way to create sequence without any gaps in snowflake. I cannot use row number as I am running the updates/inserts multiple times which will end up creating same row numbers 1 to n on every ...
0
votes
1
answer
89
views
How to create table with identity column using entity framework core code first migration to oracle db?
This is the code generated by ef core after we do add-migration
migrationBuilder.CreateTable(
name: "Provinces",
////schema: "some schema",
columns: table => new
...
0
votes
0
answers
64
views
Mysql increment field didn't work property with mybatis plus
1.entity
public class SaledData implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
...
1
vote
2
answers
122
views
Auto Increment value for non-primary key column
In my MariaDB I have two tables project and issue, the issue table contains all issues created for all projects
create table if not exists Project(
id integer PRIMARY KEY auto_increment,
`name` ...
0
votes
1
answer
199
views
Laravel Pest test ignore not resetting mariadb autoincrement ids
I have a laravel pest test that checks a redirect after data is submitted to a controller to create a client.
it('redirects to the clients show page', function () {
$user = User::factory()->...
0
votes
1
answer
52
views
Generate Automatic increment for "alt" html field on images
I'm using a php gallery script and I need to add numbers (auto increment) in the "alt" field (images).
I already tried several options from stackoverflow and unfortunately I didn't succeed.
...
0
votes
1
answer
710
views
Setting auto-increment after filling table (Firebird) with existing data (from SQL Server)
I have a table in SQL Server. Its PK, ID, is of type INT and is auto-incremented. The task I have is to get this table in a Firebird database (version 4.0.4). Remarks: we have a website that uses this ...
0
votes
1
answer
401
views
How to create incremental counter in mulesoft dataweave
We have multilevel array so we are using transformation of multiple map function. In this case how to assign a field ID with incremental value.
Input:
[
{
"productNo": "00011111&...
1
vote
1
answer
130
views
How to increment ++ from an existing value
I am working on an app to track winter bird feeder counts. I am using ++ to increment and -- to decrement.
When I try to increment an existing value, the increment re-starts at zero. For instance, if ...
0
votes
1
answer
94
views
Rename Images and save them with the new name and incrementing each 20
I have 1000 jpg files with file names:1_nb_1_0.0164032559841871, 1_nb_1_20.0611820686609, and I want to rename those 1000 with new names by incrementing two characters such as rename to this name:...
0
votes
1
answer
295
views
Is an autoincrement key always guaranteed to increase in T-SQL?
I am using an AUTOINCREMENT PRIMARY KEY in-luau of a timestamp for ordering purposes in a GROUP BY clause.
This is a minimal example to illustrate only:
CREATE TABLE Items(
ItemId BIGINT ...
2
votes
1
answer
649
views
Creating an autoincrement column via sqlalchemy
I am using a Postgresql database via sqlalchemy orm. The table is really basic:
import sqlalchemy as sa
from sqlalchemy.orm import Mapped
from sqlalchemy.orm import mapped_column
class Network(Base):
...
0
votes
1
answer
68
views
SQL not accepting AUTO_INCREMENT
New programming learner here. I am trying to create a table for blood donors, and have the id be automatically incremented upon registering new donors, but sql gives an error around auto_increment as ...
-2
votes
1
answer
135
views
AUTOINCREMENT vs No AUTOINCREMENT in SQLite
I put and did not put AUTOINCREMENT for id in person table as shown below:
CREATE TABLE person (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT # ↑↑↑↑↑↑↑↑↑↑↑↑↑
);
CREATE TABLE person ...
0
votes
1
answer
346
views
How to create a string sequence in SQLAlchemy
I am currently developing an API for invoices. And I want to create an Invoice table with invoiceNumber field that would be auto incrementing but as a string. Something like this:
INV00001
INV00002
...
0
votes
1
answer
58
views
Obtaining a combined key (year/number) in mysql with innoDB storage engine
I would like to create a combined key in an innoDB table that already has an "ID" column with auto incrementing value that works as primary key.
Assuming we have the following "...
2
votes
0
answers
205
views
Assigning a persistent and unique ID to instances of a python class
There are a number of threads on SO dealing with a similar question, e.g.
How to create a unique and incremental ID in a Python Class
Auto-incrementing IDs for Class Instances
How do you create an ...
-1
votes
1
answer
77
views
innodb missing auto-increment values [duplicate]
I am not experienced in this area. Can you tell me why autoincrement skips values?
This is my table:
CREATE TABLE `orders`
(
`id` int NOT NULL AUTO_INCREMENT,
`product_id` int NOT NULL,
`...
4
votes
1
answer
984
views
Is it guaranteed that bigserial column is unique across all partitions of a partitioned table?
I created the partitioned table in Postgres 15 with composite primary key:
CREATE TABLE T (
id bigserial NOT NULL,
date date,
...,
PRIMARY KEY(id, date)
) PARTITION BY RANGE (...
0
votes
1
answer
77
views
Auto incrementing does not occur when adding an item in PostgreSQL using Hibernate
I created a table in PostgeSQL with data for a person and marked the column "id" with the type 'SERIAL' as 'primary key', 'not null'
CREATE Script:
CREATE TABLE people (
id serial NOT NULL,...
1
vote
1
answer
526
views
What Liquibase XML element to use to reset AUTO INCREMENT counter for a column in MySQL?
In MySQL you would use this kind of SQL to reset the AUTO INCREMENT counter for a table:
ALTER TABLE my_table AUTO_INCREMENT = 200;
What is the corresponding XML element to use in Liquibase?
I'm ...
0
votes
1
answer
53
views
How to automatically increment Django IntegerField
I have a field in my model
Step=models.IntegerField()
I call it normally in the template with the following:
{{user.step}}
Now I want this field to automatically increase after every year
What is ...
0
votes
0
answers
94
views
Change ID in MySQL table permanently [duplicate]
How can I change the value of the ID in a MySQL table, for example, to "9999," while keeping the remaining IDs (1-315) unchanged and ensuring that the next autoincrement value is actually ...
0
votes
0
answers
44
views
PHP file_put_contents() make a primary key that auto_increments
this is my first time asking a question since I cant find any better solutions for my problem. I got a task to make a form by website that uses file_put_contents() for book data library.
My code ...
1
vote
2
answers
99
views
MySQL insert varchar value into int auto increment column
I noticed strange MySQL behaviour on projects staging server. Given:
create table test_table
(
id int auto_increment,
name varchar(64) not null,
constraint test_table_pk
primary ...
0
votes
0
answers
190
views
Ms access database has skipped an auto increment number (ID) after repare. How to restore it?
I have Microsoft access database. I have about 1200 records, with attached documents through forms and am generating several reports with it.
While doing data entry access just halted and I restarted. ...
-1
votes
2
answers
735
views
SQLite integer primary key without assignment/autoincrement
I have a table which requires unique IDs for each row, and which requires them to be stable if the database is rebuilt (so I can't just use rowid), but does not require that they be unique over the ...
0
votes
1
answer
137
views
Add incremented variable in jquery ajax success handler
I want to increment the value of a variable ii, but its value does not change. If I move ii++; before the alert function call, it increases but the value set to #spanstatus is always 0.
How do I ...
0
votes
1
answer
2k
views
Entity Framework trying to add null primary key with auto increment
I'm starting a new Blazor project using Entity Framework 7 and an existing database.
I created a class refering to a existing table from my database.
public class IEA_EtatsDemandes
{
public ...
0
votes
1
answer
158
views
MySQL - Single auto increment with multiple primary keys or a safe way for insert with max()+1 in MySQL
I am looking for a solution two have my second primary key column to be auto incremented depending on the first primary key.
Think about the following example case to comprehend the aspects of my goal:...
-1
votes
2
answers
1k
views
Numbering invoices yearly and different structures with SQL and PHP [duplicate]
I'm a beginner in SQL and I tried looking for an answer without any luck.
I would like to generate invoice numbers automatically with the following distinctions:
I have 2 different structures ...
0
votes
1
answer
2k
views
How to keep the auto-increment function (in SQL IDENTITY) for ID after importing from Access to SQL Server?
I'm importing tables from Access to SQL Server. The column ID in Access is auto-increment, but in SQL Server I must enter every time the ID. It's important to say that there're records in the imported ...