Most voted "sql-insert" questions
INSERT is the ANSI standard SQL command to insert records into the database.
Learn more…213 questions
Sort by count of
-
1
votes1
answer1387
viewsInsert into two tables in Android Sqlite
How do I add data to two tables on Android in a single transaction? I have two tables Client and Address, is last with a foreign key referencing the client table, and must be registered in a single…
-
1
votes0
answers253
viewsProblems with Oracle Insert with Laravel
I’m having a problem with a INSERT in Oracle used the package yajra/Aravel-oci8, where the following error returns to me: Error Code : 1722 Error Message : ORA-01722: Invalid Number Position : 260…
-
1
votes3
answers30995
viewsInsert date in Mysql via PHP
I want to insert an HTML FORM that I made the field DATE, however it is in format dd/mm/yyyy and mysql only accepts yyyy-mm-dd. How do I convert the date to insert correctly into the Mysql database…
-
1
votes1
answer77
viewsPHP MS Sql query script for My Sql
Good afternoon. How can I make a query in MS Sql and insert the values in a My Sql table through PHP? Looking at this data, you can do this insertion? #--> conexao mysql…
-
1
votes1
answer1986
viewsProblem Inserting Into SQLITE Table Using RAD STUDIO XE6
Good Afternoon, I have a problem in my code, use Rad Studio XE6 connected to a base SQLITE, when I insert values with point in the table occurs the following error for example = 'near "6.75":syntax…
-
1
votes1
answer233
viewsSQL does not keep new recordings
I’m using a Service-based Database (.MDF) to save some data from an application I’m developing. However, after I close the application, the data that was entered in the table disappears. It follows…
-
1
votes1
answer91
viewsJPQL Query for Data Insertion
How can I enter a data with JPQL containing values: @Query("insert into user values()") User insertUser(); Dice: nomeUsuario emailUsuario…
-
1
votes1
answer53
viewsDo not save information in mysql when I click on one of the radioboxes in the form
I have a form with several text fields, radiobox, selectbox, and I want to save the information in the table of the bank I use. However, I’m having a problem when I click on the first two radios…
-
1
votes1
answer103
viewsInsert an ID into SQL+PHP
I’m making a form where the user inserts the data and the same receives the confirmation along with a ID record in php with sql, I’m just not getting this final confirmation along with the id,…
-
1
votes1
answer630
viewsInner Join, multiple Inserts with multiple conditions
Well, the thing is, I don’t understand where I should start, if I should select customers first, anyway, I’m sure I’ll use inner join or some joiner because it uses other help tables. I wanted help…
-
1
votes1
answer312
viewsInsert range of numbers into an automatically SQL table
The point is that I want to insert in a table field a range of numbers that goes from 100 to 1,000,000 and I didn’t want to be doing 1 to 1. How can I do this automatically? In SQL Server…
-
1
votes1
answer244
viewsInsertion of dates in Postgresql
I would like to know how to configure the Postgre to accept date entries as follows: "12122016". I know that with the same "spelling" is possible with YMD more I would like to know how to set up to…
-
1
votes1
answer94
viewsCakephp3 HABTM error inserting data into table
I am with the error Cannot Insert Row in "addresses_companies" table, it has no Primary key in my application, after entering a company and filling in the address data and selecting a company…
-
1
votes1
answer92
viewsInsert to the C#Dynamic Database?
I’m making a insert and use a model with the Getters and Setters, when I do the insert in the values I receive to model as a parameter and use as follows sql = "INSERT INTO " + Table + "(" + campos…
-
1
votes2
answers1820
viewsColumn count does not match the value count on row 1
I need guidance on how to identify the error in this received message after importing text file: 1136 - Column count does not match the value count on row 1 The table columns are 10 and the data…
-
1
votes2
answers123
viewsProblems with Insert logic
I have a problem. I’m doing an event access control system, I created a table that records the given id,code,date,time,sit, the field sit will be 1 and 2, but I need my system to understand the…
-
1
votes2
answers1080
viewsError doing Insert in PHP database
I am trying to do the data Insert in Mysql, no error appears but does not insert the values in the database. <?php INCLUDE "conexao.php"; if (isset($_POST["submit"])) { $cod_produto =…
-
1
votes1
answer272
viewsHow to insert only elements that do not exist?
I have a script in python that searches elements of a database and saves in another, so when I run the script it is duplicating the data. sql = "INSERT INTO `alarm` (`data`, `seconds`, `culprit`,…
-
1
votes2
answers111
viewsINSERT duplicate with mysql ::PDO
Can anyone explain why when I run this code it INSERTS twice the same value in the table? I believe it is that this problem happens when I do a validation to check if the values were entered:…
-
1
votes1
answer158
viewsDoubt Mysql Insert
Good morning, I’m trying to make an Insert,plus this giving error and seems to be in the hour field,could help me identify what is wrong: Follows the Insert and the error. INSERT INTO senhas…
-
1
votes2
answers60
viewsInsert during a defined amount (PHP)
Hello, Guys, I want an action to be carried out over a certain amount of times defined by a form. For example: The user chooses 5, then the code Isere 5 records in the database. Since each record…
-
1
votes1
answer1578
viewsLaravel - Save data in the database only if it does not exist and....
I have a person registration system and there is an area with several checkbox fields that represent the social group that the current person represents: TABLES person id | nome 1 | João 2 | Maria 3…
-
1
votes1
answer279
viewsError trying to insert data via JSF-Bean Error
I’m starting to create a web application using JSF, but I try to insert some data through a form and it displays the error below: /usuario.xhtml @19,72 value="#{usuarioBean.email}": Target…
-
1
votes2
answers386
viewsLast lastInsertId ID
Good afternoon Guys I’m trying to get the ID that was entered by my class but unsuccessfully. The examples I found none worked. If anyone can help, thank you. public function…
-
1
votes1
answer221
viewsInsert and PDO problem
I am trying to make an Internet with PDO. For this I use: controller/con_clients.add.php <?php if($action == "new_client"){ $search_cod_cliente = $pdo->prepare("SELECT MAX(cli_cod_cliente) AS…
-
1
votes1
answer129
viewsDatabase insertion problem - SQL
Follows the code: Update command works: int noOfRowUpdated = ctx.Database.ExecuteSqlCommand("Update Mapa set Geo = geography::Point(47.65100, -122.34900, 4326) where Id= 1"); What does not work is…
-
1
votes1
answer58
viewsError including more than one mysql data in intel XDK javascript with PHP
I’m using the following function: $( document ).ready(function() { var $server; $server = 'http://localhost/mobile/DatabaseXDK/database/www/'; $('#inclusao').on('click', function(){ $nome =…
-
1
votes1
answer1342
viewsHow do I take the auto increment ID using Mysql and PHP and use it later?
I am creating an API in PHP and insert. I need to take the ID created in this INSERT and use later. What I find material, it seems not recommended. Any solution? Thank you. My PHP: <?php…
-
1
votes1
answer876
viewsHow to make an INSERT in postgresql with conditional default value?
We have the following simplified table for the example: create table teste( id serial not null ); The commands below cause syntax error: insert into teste( select (case when 1=1 then DEFAULT end) );…
-
1
votes2
answers1131
viewsClose modal when updating page after insert
I searched every corner of the Internet but I couldn’t find anything like my problem. I have a registration form that after doing the INSERT in the database shows a modal window and inside it a…
-
1
votes1
answer51
viewsphpMyAdmim Database Connection Error (New Code) Nothing is solving
Look, I don’t know exactly where to start but, anyway... I have the page posted below, and I’ve checked some with errors in the database and entering data in it. The code was made in case there is…
-
1
votes3
answers3361
viewsHow to convert 0 to null (Error inserting NULL into an INT field from a variable)
I am editing this question to be more didactic for other members, since there are only publications addressing this situation outside the community en. I own a field INT property UNIQUE that may…
-
1
votes1
answer57
viewsForm with automatic save
I am creating a tab form, in which has 3 tabs and each one belongs to a table, I wonder if there is a way to save what was filled in a logo tab where I change to another tab without redirecting the…
-
1
votes1
answer355
viewsError in sql-Insert command when passing a variable as parameter (python 3)
I am trying to pass my "table" variable to the mysql command, but it is returning an error (of sql) during execution. What am I missing? Here I created the table variable table = input('Table name:…
-
1
votes2
answers749
viewsIf there is any data in mysql do a PHP/Mysql update
Guys, I imagine this doubt is recurring. I even looked for some alternatives but did not work. I have a Screen where I record Service Orders with Client and PC data from it. It turns out that. I am…
-
1
votes2
answers1092
viewsHow to use Insert with multiple C# SQL records
I’m new here and also in the world of programming, today I managed to connect C# to SQL, by making a simple connection with the BD I can insert records, but when trying to insert 2 data in the same…
-
1
votes1
answer121
viewsNullpointerexception in database connection
Anyway, I’m getting one nullpointerException just that I have no idea how to deal with it, I took a look on the net about and apparently the problem is in uninitiated variables and things like that,…
-
1
votes1
answer200
viewsHow to enter values in Laravel
I am trying to use the following command to insert: $sql = "INSERT INTO tabela (campo1, campo2, campo2, campo4) values(:campo1, :campo2, :campo3,'S')"; $campos = array( ':campo1' => $nome,…
-
1
votes2
answers1931
viewsError: "Column Count doesn’t match value Count at Row 1" when inserting value in table with Trigger
After creating the Trigger: DELIMITER # CREATE TRIGGER BACKUP_PRODUTO_INS AFTER INSERT ON PRODUTO FOR EACH ROW BEGIN INSERT INTO BACKUP.BKP_PRODUTO VALUES(NULL, NEW.IDPRODUTO, NEW.NOME, NEW.VALOR,…
-
1
votes1
answer13106
viewsError Code: 1136. Column Count doesn’t match value Count at Row 1
I’m trying to insert data into a table, but I’m not getting it, giving the following error: "Error Code: 1136. Column Count doesn’t match value Count at Row 1.", someone knows how to solve? I…
-
1
votes1
answer217
viewsHow to insert a row in the sql table when clicking the button?
I have an immovable site that I am implementing the option of favorites. When opening the property and clicking favorite, it should insert in a new row in the favorite table, this one below (status…
-
1
votes0
answers438
viewsError Inserting: Incorrect integer value 'EXAMPLE' for column 'id_example' at Row 1
I am trying to insert into my mysql database through Visual Studio 2017 - C# (localhost-wamppserver) but it is giving error. The first column of the table records is the id_record which is the…
-
1
votes2
answers425
viewsInsert data into XAMPP database with php
I need to enter the data that the user puts on the website for the XAMPP database, but I’m not getting anyone to help me? Page code on which the data is placed: <label>Nome Produto :…
-
1
votes3
answers737
viewsSave auto_increment id of a table to another table in the same file
I want the value of ID automatically generated in auto_increment in the table wpne_posts is saved in another table called wpne_postmeta The INSERT code of the first action is: mysqli_query($con,…
-
1
votes1
answer220
viewsINSERT WITH TWO TABLES - PHP
I have the table students and the table payments, I am doing a gym system. I linked the two tables by placing the id_students in the payments table as foreign key. I want when registering student…
-
1
votes1
answer361
viewsHow do I leave NULL if $_POST is empty in the Mysql database?
Is there any way I can leave it as null fields that have not been filled in? When creating the table, fields have already been defined as DEFAULT NULL, but while doing the Insert - in the database…
-
1
votes0
answers30
viewsStore query result in a PDO Session
I have a SELECT that generates results normally, but when I need to take the value of some column to use on another page it does not work. Query code and attempt to pass the result from a column to…
-
1
votes0
answers41
viewsDoes not enter into Oracle bank, with Nhibernate
I have a problem in an application, developed in C#, that uses Oracle database, and access the database with Nhibernate. When trying to perform the Saveorupdate() function, the Insert is not done…
-
1
votes1
answer114
viewsInsert method does not save data
I have an application where the goal (at the moment) is to take the data typed in a form and save in the Database. And the Insert method of my Datasource always returns me false I do not understand…
-
1
votes0
answers92
viewsTrigger to ban scale insertion that is already working on that SQL Server date
Thank you for your time! 1° I’ll put the data and then I’ll point out my doubt, I’ve tried a thousand times and I can’t get the logic that works. I have the following table Scale Table CREATE TABLE…