The SQL INSERT statement allows you to insert a single record or multiple records into a table.
0
votes
1answer
15 views
In MySQL, how can I use the autoincrement value in another column at the time of the INSERT?
I am looking to have the automagically set autoincrement included in another column during the insert. For example in a table where ID is the autoincrement and Name is the other column, I'd like to ...
1
vote
0answers
11 views
Error while inserting
Oracle version: 11.2.0.1
I am trying to insert a row in one of my table. But I get an error. Following is the insert statement.
INSERT INTO FURNAC_LOG (TRANSACTIONID,
...
-3
votes
2answers
27 views
MySQL No database selected
I have been developing a testimonial app for a clients facebook page that she can edit herself!
I am having a problem with inserting it into the database! I has wrote it in MySQLi forst but have now ...
0
votes
0answers
4 views
need help auto incrementing a powershell script with an SQL statement in it?
im connected to a server and im making a powershell script with an SQL Statement. i just want to know how to auto increment. i need it for two different columns, one with ID<4> and Badge#<5>. i ...
1
vote
1answer
29 views
Trying to insert into access database via SQL getting ID from another table
I have 2 tables in an Access database:
tblMachine
fields:
MachineID
MachineDescription
tblProblem
fields
ProblemID
MachineID
ProblemDescription
I am trying to add a new record into tblProblem, ...
0
votes
0answers
11 views
inserting mixed data into DB2 using linked server
I'm going nuts. I am trying to put together a stored procedure to insert data into our DB2 order note file. The DB2 database has a bunch of decimal fields defined. When I am trying to put together the ...
-1
votes
1answer
40 views
Idempotent INSERT not working as expected. Is my query logic faulty? [closed]
I am expecting this to not insert data every time I execute this statement. It should only insert data effectively once a day. Thats what I want this to do. Is there something wrong with my logic ...
-1
votes
0answers
11 views
Insert into… select with ordered results in Amazon Redshift [closed]
I'm trying to insert an ordered set of results into a table that has an IDENTITY column which inserts sequential integers, the idea being that I want my results to have a rank order ID. Unfortunately, ...
0
votes
2answers
28 views
Insert into MySQL Table PHP
I am having some trouble making a simple form to insert data into a MySQL table. I keep getting this SQL error:
"Error: You have an error in your SQL syntax; check the manual that corresponds to your ...
0
votes
2answers
17 views
MySQL INSERT […] SET not working
So what's wrong with this query:
INSERT `ttf` SET `weight_id` = 4 WHERE `weight_id` = 4
Syntax reference from the official MySQL manual:
INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]
...
0
votes
0answers
21 views
creating a script running thorugh powershell that will query multiple tables and create a cardholder and badge
if you read the title then you the baisc gist of it.
im creating a script that takes in an insert into query and creates a cardholder, badge and access level. also it has to run though powershell ...
0
votes
1answer
20 views
MySQL insertion into database table with lots of columns (using jdbc)
I have a table with 10 columns. Each row in the table was is originally a JSON Object that I receive in this format.
{"mainEntity":
"atlasId": 1234567
"calculatedGeography": False
...
0
votes
2answers
37 views
Change values before insert into table / PostgreSQL
Ive got the following problem. I want to change some values of INSERT statement, e.g. there's a query:
INSERT INTO table(a,b) values(x,y);
But table has also another column c. I want to check ...
0
votes
1answer
16 views
Insert a row based on another row's data SQL Server 2008
I made a schema example: http://sqlfiddle.com/#!3/6a134/1
Let's say I have a table called cart which contains customer_id's and item codes they want to buy.
I want to add Item "ZZZ" for any order ...
-4
votes
0answers
29 views
INSERT IF NOT EXISTS and show total history [closed]
Suppose a product has a serial no. AAA112 and it stored as stock in hand and it goes stock out for two days. Then AAA112 again came back for stock in hand and this process happens for few times. My ...
0
votes
1answer
66 views
Adding value to parameter in C# (asp.net) to be saved in SQL Server
I am quite new to ASP.NET and I am making my first application for my school project and I have one problem.
I have my database for adding files and pictures. I used a SqlDataSource and DataList, so ...
0
votes
0answers
20 views
Designing of an Android Message Inbox
I am designing message inbox as the android phones have,
I am creating my database and inserting the message into the tables ,the code which I am using is,
...
2
votes
1answer
37 views
How to transfer Data automaticly between MySql and Sql Server back and fourth?
I need to build a procedure to read data from SQL Server and insert it into MySql. More I also need another procedure to read data from MySql Server and insert it into SQL Server.
I never done such a ...
0
votes
0answers
22 views
MySQL How to update updated_by field only when new data is saved or inserted
I have a frontend PHP application which will save data in a MySQL database. The updated_by value will change since it will be the user who is updating the record.
I would like to update the updated_by ...
1
vote
2answers
23 views
MS SQL Index value updates
Setup:
SQL Server 2008 R2
Back Story:
We have a proc that is called in several threads at once. These threaded proc calls will sometimes write overlapping (duplicate) data to the table they write to. ...
2
votes
2answers
44 views
Insert query not working in php
I am new to php.I am inserting two integer values in my table using the following code.
<?php
include 'config.php';
$from = 1;
$to = 3;
$query = "INSERT INTO 'friendrequests'('from','to') ...
0
votes
3answers
22 views
SQL - keep values with UPDATE statement
I have a table "news" with 10 rows and cols (uid, id, registered_users, ....) Now i have users that can log in to my website (every registered user has a user id). The user can subscribe to a news on ...
0
votes
1answer
73 views
Inserting into SQLITE in cocos2d-x
I am using cocos2d-x to create an app in android which needs to use a database.
I have used the following method, which I found whilst searching forums, to use SQLITE in cocos2d-x :
use ...
1
vote
1answer
53 views
Parameterized INSERT with Memo and Text Fields in VBA / MS-ACCESS?
I'm trying to do a simple parametrized insert with MS-Access 2007 and I keep getting the following error (3708) from ADODB.Parameters:
Parameter object is improperly defined. Inconsistent or ...
0
votes
2answers
28 views
PostgreSQL insert into statement
I am selecting all records from a table row and insert into same table. but it showing the PK key duplicate. How to skip the pk key field in postgresql insert into statement?
eg.
insert into reviews ...
0
votes
5answers
51 views
Inserting data to table (mysqli insert)
I've been looking at this code for a while now and I cant see where the problem is... been reading the whole stackoverflow and still cant see where my error is.
<?php
...
2
votes
2answers
59 views
Insert multiple rows SQL from a form with same titles
I have this form, which when you click on "New row" there are popping up another field with new inputs. What I want to achieve with this is an user-friendly form which FOREACH "New item" ->
("INSERT
...
2
votes
1answer
45 views
Can't INSERT values into tables
I have 3 tables in MySQL database:
CREATE TABLE bank(
idBank int(11) NOT NULL PRIMARY KEY auto_increment,
nameBank varchar(50)
);
CREATE TABLE region(
idRegion int(11) NOT NULL PRIMARY KEY ...
0
votes
1answer
77 views
SQL Insert data from multiple tables in different database
I have cat table in a2 database I want to insert into id, img columns from different tables with different database
INSERT INTO a2.cat (id, img) SELECT id FROM topshop_test.product ,
SELECT ...
0
votes
1answer
26 views
How to move data between 2 tables / with different columns in different databases with multiple values
INSERT INTO a2.cat (id, img) SELECT category_id, category_id FROM topshop.category;
all I need to insert plus values in the column img from the category_-id
INSERT INTO a2.cat (id, 'c'+img+'.jpg') ...
0
votes
1answer
23 views
INSERT query from trigger inserts NULL
I have the following query in SQL Server 2005:
DECLARE @issueid numeric(10,0)
DECLARE @domain nvarchar (255)
SET @issueid = (SELECT issueid FROM issues WHERE issueid = 4850)
SET @domain = (SELECT ...
1
vote
2answers
39 views
PostqreSQL Duplicate Values WHERE NOT EXISTS
I made this code:
INSERT into author(authorfirstname1, authorlastname1,authorfirstname2, authorlastname2)
select ...
0
votes
0answers
21 views
Trigger to delete previous data on INSERT
My table has the following columns: type, how, what, index
I need a trigger so when I insert a new record containing:
--TYPE--HOW--WHAT--INDEX--
INSERT INTO table VALUES(10, ...
0
votes
1answer
47 views
PHP MySQL Insert from drop down menu
Just a quick question. I am sure it is not as complicated as I think. I have a page that has 4 drop down menus. These are all populated from a database which is MySQL. Upon a submission I would like ...
0
votes
0answers
25 views
How to test if a method is thread safe?
sometime happen to choose between to make a static or instance method.
There is some code snippet to test if the static method is thread safe?
In this case, I would like to make a static method that ...
0
votes
2answers
33 views
Insert into with Select and Sum
So I am trying to Insert Into one Table from a Select Query of another table. I figured I had to do it this way because I am trying to SUM several columns within the Insert. Ultimately I want this ...
0
votes
1answer
67 views
Insert/Update SQL table from observablelist
Ok, so I'm working with an ObservableList, which is working fine, but now I need to use the observable list to insert rows into and update rows in an SQL database table. I've found little info on ...
0
votes
2answers
34 views
oracle plsql WITH statement combined with INSERT
During migration of postgresql 9 functions faced the following issue:
in Oracle you can use WITH just in complex select statements. Meanwhile in postgres (and MS SQL 2008 too) you can use WITH and ...
1
vote
1answer
43 views
Mysql: insert a new row in a child table with new values except for foreign key column which is obtained from parent table
I'm having this situation. i want to insert a new row into a table which has a foreign key constraint to another table. when i insert a new row, i have new values obtained from user input except for ...
0
votes
1answer
17 views
Copy SQLite table including metadata
I wanted to add a constraint to an existing column in my SQLite database. However, I read that it is not possible to do so.
I tried the solution from How do I rename a column in a SQLite database ...
1
vote
2answers
31 views
Insert query complaining about syntax?
I am trying to insert record from c# window form to access 2007 database, but I am getting this error -
Error: Syntax error in INSERT INTO statement.
A first chance exception of type ...
1
vote
1answer
51 views
New to SQL - Trouble getting quarterly date output
I'm really new to sql and databases in general. Trying to teach myself the language but I'm stuck and would like to know what's wrong. So here's what I have:
1976-01-01,6.1
1976-04-01,5.7
...
0
votes
0answers
70 views
SQL Update table from not exists statement
Still new but learning lots.
I have 2 tables AVDMASTER and AVDupdates.
I would like to update the current existing row(s) in AVDMASTER (Fields: OWNER, REG, PREVIOUS) with new data from AVDupdates ...
1
vote
1answer
54 views
sql insert value from another table with original nulls but not unmatched entries
OK. So this is a hard one to explain, but I am replacing the type of a foreign key in a database. To do this I need to update the values in a table that references it. That is all fine and good, and ...
0
votes
1answer
21 views
pdo insert getting \ in the url
I am trying to insert html by tinymce.
For example:
<img title="q" src="../kcfinder/upload/image/3b5330574c883fe1040eaddeb596ea20.jpg" alt="q" width="640" height="480" />
the PDO makes this ...
0
votes
2answers
47 views
Write partly tab-delimited data to MySQL database
I have a MySQL-Database with 7 Columns (chr, pos, num, iA, iB, iC, iD) and a file that contains 40 million lines each containing a dataset. Each line has 4 tab delimited columns, whereas the first ...
1
vote
2answers
114 views
SQL INSERT query being executed twice
I'm at my wit's end here. I've tried in all different browsers and still get the same trigger error message Notice: Duplicate entry for key 'PRIMARY' However, it's still inserting into the database. I ...
0
votes
1answer
25 views
Copy one table row to another using SQL
For me, this works:
INSERT INTO table_A (name, age, city) SELECT name, age, city FROM
table_B WHERE id=1
But now I want to set value for the column 'status' in table_A (this values is not ...
0
votes
2answers
76 views
Entering data into database
I am trying make a program to first show all results in the database then get someone to enter a match result, but when i try to insert the data i keep getting this error:
* Cannot execute insertion! ...
-2
votes
1answer
58 views
Insert value in sqlite database to the first row in a specified column that is null
I'm trying to write a program that will automatically insert a data into a given table in sqlite. Here's how my table looks like:
For example, I want to input a new value data5 into col3, here's ...