Reputation: 1
about to pull my hair out. Getting an error under Frankie saying I'm "missing closing parenthesis". see below:
INSERT INTO storelocals (id, name, address, lat, lng)
values(Frankie Johnnie & Luigo Too,"939 W El Camino Real, Mountain View,CA",37.386339,-122.085823
Amici's East Coast Pizzeria,"790 Castro St, Mountain View, CA",37.38714,-122.083235
Kapp's Pizza Bar & Grill,"191 Castro St, Mountain View, CA",37.393885,-122.078916
Round Table Pizza: Mountain View,"570 N Shoreline Blvd, Mountain View, CA",37.402653,-122.079354
Tony & Alba's Pizza & Pasta,"619 Escuela Ave, Mountain View, CA",37.394011,-122.095528
Oregano's Wood-Fired Pizza,"4546 El Camino Real, Los Altos, CA",37.401724,-122.114646
Round Table Pizza: Sunnyvale-Mary-Central Expy,"415 N Mary Ave, Sunnyvale, CA",37.390038,-122.042034
Giordano's,"730 N Rush St, Chicago, IL",41.895729,-87.625411
Filippi's Pizza Grotto,"1747 India St, San Diego, CA",32.723831,-117.168326
Pizzeria Paradiso,"2029 P St NW, Washington, DC",38.90965,-77.0459
Tutta Bella Neapolitan Pizzera,"4918 Rainier Ave S, Seattle, WA",47.557704,-122.284985
Touche Pasta Pizza Pool,"1425 NW Glisan St, Portland, OR",45.526465,-122.68558
Piecora's New York Pizza,"1401 E Madison St, Seattle, WA",47.614005,-122.313985
Pagliacci Pizza,"550 Queen Anne Ave N, Seattle, WA",47.623942,-122.356719
Zeeks Pizza - Phinney Ridge,"6000 Phinney Ave N, Seattle, WA",47.67267,-122.354092
Upvotes: 0
Views: 6615
Reputation: 108400
You need parens around each set of values (each row) you are inserting, and you need to enclose your string literals in quotes.
To insert a single row, enclose the values within an opening and closing paren, e.g.
INSERT INTO storelocals (name, address, lat, lng) VALUES
('Frankie Johnnie & Luigo Too',"939 W El Camino Real, Mountain View, CA",37.386339,-122.085823)
To insert multiple rows, you separate the rows with commas (I think of it as basically replace that first line (the INSERT ... VALUES
line) with a comma before each subsequent row:
INSERT INTO storelocals (name, address, lat, lng) VALUES
('Frankie Johnnie & Luigo Too',"939 W El Camino Real, Mountain View, CA",37.386339,-122.085823)
,
('Amici''s East Coast Pizzeria',"790 Castro St, Mountain View, CA",37.38714,-122.083235)
,
('Kapp''s Pizza Bar & Grill',"191 Castro St, Mountain View, CA",37.393885,-122.078916)
Note that white space (such as new line characters) don't affect the statement, I just added the new line characters to better exhibit the syntax. Note the opening and closing paren around each "row" of data, and note that single quotes within a string literal enclosed in single quotes needs to be "escaped" by prepending with an extra single quote. For example, the string literal:
'Amici''s'
evaluates to a value of
Amici's
EDIT
The column list in the INSERT statement has to match the list of values supplied for the row. (The first row value goes into the first column, the second value into the second column, etc.
In the OP statement, it appears that a value is not being supplied for the referenced id
column.
So either, the reference to the id
column should be removed from the column list. Or, the values list needs to include a value for that column. The keyword NULL
can be used to specify the "null" value.
Upvotes: 1
Reputation: 4544
You're missing closing parenthesis actually... Just add it at the end.
);
Upvotes: 0