Questions tagged as 'insert'

0
answers

Laravel-How can I insert in tables with many-to-many relationship when I have foreign keys created in mysql through migrations?

When I submit the form, it shows me this: error: Integrity constraint violation: 1452 Can not add or update to child row: a foreign key constraint fails (bolsa_empleo.aplicante_empleo, CONSTRAINT aplicantes_empleo_aplicante_usuario_id_foreign FO...
asked by 02.10.2018 / 14:08
1
answer

Avoid entering duplicate data in an Oracle table

I would like to know how to create a Trigger in Oracle that prevents data from duplicating data in a table. To start I have my temporary table: CREATE TABLE temporal( Nombre varchar(50), Tipo varchar(50), Pais varchar(50) ) That when you...
asked by 02.01.2019 / 03:39
4
answers

Increase Id with an INSERT in SQL Server

I have a table with different fields, I want to do a INSERT in which the new sentences have the Id from the last one. How could I do it? I thought about doing something like this: insert into id = id + 1 But I'm not conv...
asked by 22.08.2017 / 09:41
1
answer

Mysql Transaction (Mysql)

I have a concern as I can improve this query. Well, I'm learning to use Transaction. one of my doubts is how can I use the rollback on error DELIMITER $$ CREATE PROCEDURE sp_insert_transaction( IN _id_usuario INT, IN _id_proveedor INT, IN _fec...
asked by 04.05.2018 / 17:47
1
answer

Error inserting into mysql DB with PHP PDO

I'm doing an insert with PHP PDO to a mysql database, I pass an array for the parameters, but it works and I get the following error SQLSTATE [HY093]: Invalid parameter number: parameter was not defined this is the connection method publi...
asked by 10.09.2018 / 00:03
1
answer

Duplicate automated log SQL server

I have the following problem: In the BDD I have records of thousands of products with the invoice date and the amount that was sold. What I need is to add records for all the product codes that I have registered, taking all the dates from the...
asked by 27.08.2018 / 21:19
2
answers

Trigger SQL Server insert record if certain field is updated

Good afternoon colleagues I have this trigger to insert a record but only if the teststatus field changes, but even if there are other fields that are updated I still insert the record someone knows why create trigger trTestStatusInsertarAct o...
asked by 28.06.2017 / 22:54
1
answer

Insert data where the already defined id exists! in codeigniter

I hope you had a nice Christmas. It turns out that I have a table called votes with the following fields: id , option , name , mail , rut , cond1 , cond2 , date is a voting system then when voting is saved in the db the ID...
asked by 26.12.2016 / 14:54
0
answers

Concatenate results of last numFile (id) registered and another update field

I need to know how to concatenate results obtained after a insert and update a field, with the information ... The insert, the isset and others work correctly, all I want to do is after if ($result > 0) . In $query2 I'm...
asked by 04.01.2019 / 19:08
2
answers

Find a data from a table and place that data in another ORACLE

I have a table in an Oracle database called temporary CREATE TABLE temporal( Nombre varchar(50), Tipo varchar(50), Pais varchar(50) ) ------Datos------ ---------------------------------- Nombre | Tipo | Pais -----------------------...
asked by 03.01.2019 / 08:02