Questions tagged [multiple-insert]

Use this tag for questions about inserting multiple rows in a single statement into an SQL database.

Multiple row inserts are a feature of many SQL databases. They're a feature of the SQL-92 standard.

The most common syntax for multiple row inserts is similar to a normal INSERT INTO statement, but with multiple value groups separated by comma's

INSERT INTO MyTable(Value1, Value2)
VALUES 
    ('Value1Row1', 'Value2Row1'), 
    ('Value1Row2', 'Value2Row2'),
    ('Value1Row3', 'Value2Row3')

Alternatively, multiple row inserts can be achieved by using an INSERT INTO ... SELECT statement and UNION queries in many RDBMS.

For more information, see Wikipedia on multi-row inserts.

81 questions
0
votes
0 answers

Inserting many objects in Bash script

I am trying to use multiple inputs at the same files in a command as an output, from this question I made looping object as inputs in BASH, SHELL script The user Konsolebox and all the others were very helpful in giving me to understand how the…
George
  • 128
  • 3
  • 12
0
votes
1 answer

jQuery mobile multiple html

I am new for jQuery mobile. My project consist of 30 screen++. So I separate my screen to each single html. But now i facing one issues , because i need to include cordova.js to my project. So did i need to include cordova.js to all html ? It tat…
user998405
  • 1,329
  • 5
  • 41
  • 84
0
votes
0 answers

Do multiple insert in a stored procedure

I need to do a multiple insert in a stored procedure with MySQL. I've been looking about this but I didn't find almost any information or examples at all. The number of messages (inserts) varies. Sometimes could be one, sometimes could be twenty. In…
cooper
  • 635
  • 1
  • 8
  • 23
0
votes
1 answer

How to process multiple html inserts?

I'm trying to create multiple HTML inserts in the same form so I can quickly insert multiple lines into my database to save time. However I'm not really sure how to process this.
SkillSet12345
  • 881
  • 3
  • 14
  • 25
0
votes
4 answers

Adding incremented value to new column

i am trying to add incremented values to a new column in table. Here is a sample structure of table --------------------- Name - class - id --------------------- abbc - 2 - null efg - 4 - null ggh - 6 - null --------------------- i…
AddyProg
  • 2,960
  • 13
  • 59
  • 110
0
votes
1 answer

syncronized(this) is not working?

Need to create a multiple user application in java with multiple insert at a time so i tried to maintain a queue using synchronized (this) in my program but it is not up to the mark. which will be the better option than synchronized. any help in…
Prabakar Gutz
  • 37
  • 1
  • 2
  • 10
0
votes
1 answer

how to insert different querys answers into a table

I'm trying to insert some dates into a table. I know how to insert values if the dates are statics, I mean "4", "car", "1456", etc, and I also know how to insert one query answer into a table, but I don't know how to do it when I want to insert the…
0
votes
1 answer

Python list of list selective insertion

I have two lists both of them of the same size I have 28 sets, and I need to count how many elements per set there are, these sets may also be empty, since they are the fruit of a clustering analysis. I was thinking to have a list of lists called…
MixturaDementiae
  • 115
  • 1
  • 2
  • 9
0
votes
3 answers

Multiple insert in mysql using php

I made a form which takes the attendance of around 11 people and what i need is to insert the daily attendance in a database. i want to use one single query to insert the attendance of all employees at once instead of writing 11 different queries…
0
votes
1 answer

java 1.4 :how to insert multiple records in a database with one single hit using executeBatch?

i am reading records data from a file(records count can be up to thousands ).Now i want to insert each record in to database.I want to insert all of records in one hit to reduce performance hit. If i use addBatch(String sqlQuery ) on statment…
Maddy.Shik
  • 6,609
  • 18
  • 69
  • 98
0
votes
1 answer

DB2: Insert Query

There is table from which I need to select some data based on date criteria which I can do after that need to insert the same data in the same table with the value of one of the columns which is also a key field needs to be changed before insertion.…
Shubhra
  • 9
  • 1
  • 6
0
votes
8 answers

Insert multiple data at once

Though there are some same questions here, still I want to post my own question as I think I made a solution, but it's not working. Here is the following code: $i=1; while ( $i<= 10) { $i++; $sql = "INSERT INTO job (Category, Title,…
Shahriar Kabir
  • 274
  • 1
  • 9
  • 26
0
votes
1 answer

Multiple insert in MySQL with Ajax

Hey guys, I'm having trouble in inserting my values into MySQL using PHP and Ajax. I'm trying to insert into MySQL with single button with multiple input. JS: $('#save_grade_button').click(function (){ var B_grade = []; …
Aoi
  • 1,015
  • 6
  • 14
  • 27
0
votes
1 answer

Copy C# datatable into mysql database table

I have created one DataTable in C# dynamically. I want to insert this whole DataTable in MySql database table. I am using MySql hence SqlBulkCopy is not an option for me. I have tried MySqlBulkLoader but it seems it only insert data from file. I…
Pradip Prajapati
  • 152
  • 1
  • 4
  • 18
0
votes
2 answers

multiple inserts into mysql using php

I have a script that inserts a company id, user id and a datetime of the transaction when someone enters their email. Now I have to add a dropdown select box that allows for the user to select the number of donations they want to make so the only…
robk27
  • 683
  • 1
  • 12
  • 23