I have tried every way I can find with Google to insert multiple rows in Access with queries.
None of the these are working for me:
INSERT INTO MyTable (fld02, fld02, fld03)
SELECT '1','2','3'
UNION SELECT '4','5','6'
UNION SELECT '7','8','9'
INSERT INTO faculty1 (first_name, last_name, gender, birthdate, address, city, phone, salary, area_of_expertise)
VALUES ('a','b','Male','January 15, 1955','4202 E Fowler Ave','Tampa','813-974-2268','50000','Computer Engineering');
VALUES ('c','d','Male','October 22, 1948','4202 E Fowler Ave','Tampa','813-974-1538','80000','Computer Engineering');
VALUES ('e','f','Male','May 15, 1933','4202 E Fowler Ave','Tampa','813-974-4425','120000','Computer Engineering');
VALUES ('g','h','Female','December 3, 1960','4202 E Fowler Ave','Tampa','813-974-1276','60000','Computer Engineering');
VALUES ('i','j','Female','November 17, 1962','4202 E Fowler Ave','Tampa','813-974-2154','62000','Computer Engineering');
INSERT INTO faculty1 (first_name, last_name, gender, birthdate, address, city, phone, salary, area_of_expertise)
VALUES ('a','b','Male','January 15, 1955','4202 E Fowler Ave','Tampa','813-974-2268','50000','Computer Engineering');
INSERT INTO faculty1 (first_name, last_name, gender, birthdate, address, city, phone, salary, area_of_expertise)
VALUES ('c','d','Male','October 22, 1948','4202 E Fowler Ave','Tampa','813-974-1538','80000','Computer Engineering');
INSERT INTO faculty1 (first_name, last_name, gender, birthdate, address, city, phone, salary, area_of_expertise)
VALUES ('e','f','Male','May 15, 1933','4202 E Fowler Ave','Tampa','813-974-4425','120000','Computer Engineering');
INSERT INTO faculty1 (first_name, last_name, gender, birthdate, address, city, phone, salary, area_of_expertise)
VALUES ('g','h','Female','December 3, 1960','4202 E Fowler Ave','Tampa','813-974-1276','60000','Computer Engineering');
INSERT INTO faculty1 (first_name, last_name, gender, birthdate, address, city, phone, salary, area_of_expertise)
VALUES ('i','j','Female','November 17, 1962','4202 E Fowler Ave','Tampa','813-974-2154','62000','Computer Engineering');
I even tried a single entry, and didn't work either.
INSERT INTO faculty1 ( first_name, last_name, gender, birthdate, address, city, phone, salary, area_of_expertise )
VALUES ('a', 'b', 'Male', 'January 15, 1955', '4202 E Fowler Ave', 'Tampa', '813-974-2268', '50000', 'Computer Engineering');
Is there something wrong with my CREATE
statement?
CREATE TABLE faculty1
(
facultynumber int PRIMARY KEY,
first_name CHAR(20),
last_name CHAR(20),
gender CHAR(10),
birthdate CHAR(25),
address CHAR(50),
city CHAR(20),
phone CHAR(20),
salary INTEGER,
area_of_expertise CHAR(20)
);
http://www.pixhost.org/show/1360/23620036_access_error.jpg
This surprisingly works. Is Access not able to handle you not giving a primary key? I thought this was optional.
http://www.w3schools.com/sql/sql_insert.asp
INSERT INTO faculty1 ( facultynumber, first_name, last_name, gender, birthdate, address, city, phone, salary, area_of_expertise )
VALUES ('5', 'a', 'b', 'Male', 'January 15, 1955', '4202 E Fowler Ave', 'Tampa', '813-974-2268', '50000', 'Computer Engineering');