Questions tagged as 'sql-insert'

1
answer

Doubt - Insert table SQL Server 2012

I need to insert some information in the table called task, however, only when a certain condition is accepted that in the case are these two date fields, I put it to today for example if it were manual, that is, it would insert into the system...
asked by 05.10.2017 / 14:25
2
answers

model and controller in codeigniter to do insert in firebird using generator

I'm new to codeigniter and I need to define my controller and model, so when calling the model inserir() , the controller takes the last ID of the generator of each table that wants to do the insert. Let me give you an example: control...
asked by 13.01.2016 / 14:24
2
answers

INSERT INTO with filter in MySQL

I'm trying to create an INSERT INTO in an X table by making a filter in the Y table, but I get a syntax error. I researched what may be wrong, but not find out. INSERT INTO products ( SELECT * FROM products AS P WHERE P.FK_ID_QUOTE = 1...
asked by 27.11.2018 / 14:03
3
answers

How to convert 0 to null (Error inserting NULL into an INT field from a variable)

I'm editing this question to make it more didactic for other members, since there are only publications addressing this situation outside the community. I have a INT field with UNIQUE property that can have NULL value. The value th...
asked by 12.09.2017 / 19:14
1
answer

How do I insert a row in the sql table when I click the button?

I have a real estate website that I'm implementing the favorites option. When you open the property and click favorite, it should insert a new row in the favorite table, the one below (status 1 is favorite), and if you "uncheck" it removes the r...
asked by 16.05.2018 / 20:14
1
answer

Problem to insert into the database - SQL

Follow 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 insert command: int noOfRowInserted = c...
asked by 07.01.2017 / 04:55
1
answer

Problem with insert using mysql_query ()

I'm working on an old system, where it makes the connection to the bank still with mysql_query . I've used too little mysql_query and the last time I used it, it's got a lot of time, I'm more accustomed to PDO . I am try...
asked by 24.05.2017 / 15:05
2
answers

INSERT duplicate with mysql :: PDO

Can anyone explain why when I run this code it INSERT twice the same value in the table? I believe that this problem happens when I do a validation to verify that the values have been entered: if(!$lc_follow_dados->execute())...
asked by 10.02.2016 / 15:34
1
answer

The INSERT statement conflicted with the FOREIGN KEY C #

I have this code to insert values into a table: conn.Open(); comm.CommandText = @"INSERT INTO ArticleBarCode(Code, Code_Article, BarCode, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn, IsDeleted) VALUES (@code, @codearticle,...
asked by 28.04.2017 / 12:00
1
answer

Doubt insert MySQL

Good morning,  I'm trying to make an insert, plus this giving error and seems to be in the field hour, could help me identify what's wrong:  Here is the insert and the error. INSERT INTO senhas...
asked by 01.03.2016 / 14:20