tagged [insert]

Create table and fill with test data provided as text

Create table and fill with test data provided as text What is your way of creating and populating test tables in MySQL when looking into SO questions where tables (but not CREATEs) and test data (but ...

23 May at 12:33

"INSERT IGNORE" vs "INSERT ... ON DUPLICATE KEY UPDATE"

"INSERT IGNORE" vs "INSERT ... ON DUPLICATE KEY UPDATE" While executing an `INSERT` statement with many rows, I want to skip duplicate entries that would otherwise cause failure. After some research, ...

29 Apr at 04:33

PHP mySQL - Insert new record into table with auto-increment on primary key

PHP mySQL - Insert new record into table with auto-increment on primary key Wondering if there is a shorthand version to insert a new record into a table that has the primary key enabled? (i.e. not ha...

20 Sep at 21:42

MySQL How do you INSERT INTO a table with a SELECT subquery returning multiple rows?

MySQL How do you INSERT INTO a table with a SELECT subquery returning multiple rows? MySQL How do you INSERT INTO a table with a SELECT subquery returning multiple rows? I to populate

23 Feb at 22:37

Inserting multiple rows in a single SQL query?

Inserting multiple rows in a single SQL query? I have multiple set of data to insert at once, say 4 rows. My table has three columns: `Person`, `Id` and `Office`. ``` INSERT INTO MyTable VALUES ("John...

17 Oct at 13:25

Add new row to dataframe, at specific row-index, not appended?

Add new row to dataframe, at specific row-index, not appended? The following code combines a vector with a dataframe: However this code always inserts the new row at the end of the dataframe. How can ...

15 Nov at 16:24

How to insert multiple rows from array using CodeIgniter framework?

How to insert multiple rows from array using CodeIgniter framework? I'm passing a large dataset into a MySQL table via PHP using insert commands and I'm wondering if it's possible to insert approximat...

What is the preferred/idiomatic way to insert into a map?

What is the preferred/idiomatic way to insert into a map? I have identified four different ways of inserting elements into a `std::map`: Which of those is the preferred/idiomatic way? (And is there

26 Sep at 06:51

Insert an element at a specific index in a list and return the updated list

Insert an element at a specific index in a list and return the updated list I have this: Is there a way I can get the updated list as the result, instead of updating the original list in place?

23 Aug at 19:10

MySQL INSERT INTO ... VALUES and SELECT

MySQL INSERT INTO ... VALUES and SELECT Is there a way to insert pre-set values and values I get from a select-query? For example: I have the value of "A string" and the number 5, but I've to find the...

11 Oct at 10:37

jquery add row on click only if it's empty?

jquery add row on click only if it's empty? The code below works, insomuch that if I click in an input field, it'll add another row. I'm trying to figure out though, how to do that if the input field ...

20 Apr at 03:56

Insert the same fixed value into multiple rows

Insert the same fixed value into multiple rows I've got a table with a column, lets call it `table_column` that is currently `null` for all rows of the table. I'd like to insert the value `"test"` int...

3 May at 21:23

How to insert a row in an HTML table body in JavaScript

How to insert a row in an HTML table body in JavaScript I have an HTML table with a header and a footer: I am try

19 Nov at 12:54

Get the new record primary key ID from MySQL insert query?

Get the new record primary key ID from MySQL insert query? Let's say I am doing a MySQL `INSERT` into one of my tables and the table has the column `item_id` which is set to `autoincrement` and `prima...

15 Sep at 11:34

PostgreSql INSERT FROM SELECT RETURNING ID

PostgreSql INSERT FROM SELECT RETURNING ID In PostgreSql 9.2.4 I have two tables: `user (id, login, password, name)` and `dealer (id, user_id)`. And I want to insert into both tables returning id of c...

4 Feb at 11:47

PDO Prepared Inserts multiple rows in single query

PDO Prepared Inserts multiple rows in single query I am currently using this type of SQL on MySQL to insert multiple rows of values in one single query: ``` INSERT INTO `tbl` (`key1`,`key2`) VALUES ('...

28 Apr at 06:53

Return ID on INSERT?

Return ID on INSERT? I have an INSERT query and I want the DB to return the ID of the row I just inserted. ``` sqlString = "INSERT INTO MagicBoxes (OwnerID, Key, Name, Permissions, Active, LastUpdated...

2 Oct at 23:0

Oracle SQL: Use sequence in insert with Select Statement

Oracle SQL: Use sequence in insert with Select Statement Basically I want to run the following query: ``` INSERT INTO historical_car_stats (historical_car_stats_id, year, month, make, model, region, a...

2 Feb at 05:7

single quotes escape during string insertion into a database

single quotes escape during string insertion into a database Insertion fails when "'" is used. example string is: He's is a boy. I've attempted to skip the "'" using an escape symbol , but I believe t...

11 Aug at 06:10

Increment a database field by 1

Increment a database field by 1 With MySQL, if I have a field, of say logins, how would I go about updating that field by 1 within a sql command? I'm trying to create an INSERT query, that creates fir...

4 May at 05:11

Insert a row to pandas dataframe

Insert a row to pandas dataframe I have a dataframe: and I need to add a first row [2, 3, 4] to get: I've tried `append()` and `concat()` functions but can't

11 Dec at 03:54

Is there a non-commercial alternative to Z.EntityFramework.Extensions?

Is there a non-commercial alternative to Z.EntityFramework.Extensions? Entity Framework can be very slow on mass insert/update/delete operations. Even the often suggested tweaks to turn off AutoDetect...

INSERT IF NOT EXISTS ELSE UPDATE?

INSERT IF NOT EXISTS ELSE UPDATE? I've found a few "would be" solutions for the classic "How do I insert a new record or update one if it already exists" but I cannot get any of them to work in SQLite...

How can I insert values into a table, using a subquery with more than one result?

How can I insert values into a table, using a subquery with more than one result? I really would appreciate your help. Probably it's a quite simple problem to solve - but I'm not the one .. ;-) I have...

13 Mar at 21:52

MySQL - ignore insert error: duplicate entry

MySQL - ignore insert error: duplicate entry I am working in PHP. Please what's the proper way of inserting new records into the DB, which has unique field. I am inserting lot of records in a batch an...

10 Aug at 08:19