0

Insert into query does not seem to be working, I have changed the format various times but unable to make it work. Using sql on Netbeans 8.0.2

INSERT INTO “TypesOfApps” (“Lifestyle”, “SocialMedia”,“Utility”, “Games”,  “Productivity”, “News”)
      VALUES 
    (“Fitness”, “Facebook”, “Reminders”, “Angry Birds”, “Docs”, “Buzfeed”),
    (“Dating”, “Instagram”, “Calculator”, “Clash of Clans”, “Google Sheets”, “SmartNews”),
    (“Food”, “Pinterest”, “Flashlight”, “Subway Surfer”, “Wallet”, “Google News”),
    (“Music”, “Snapchat”, “Weather”, “Coin Dozer”, “Evernote”, “Feedly”),
    (“Travel”, “Twitter”, “Calendar”, “CandyCrush”, “WunderList”, “Reddit”);

Have also changed it - as i googled the problem and it seemed to fix it for people - like this:

INSERT INTO “TypesOfApps” (“Lifestyle”, “SocialMedia”,Utility”, “Games”, “Productivity”, “News”)
 VALUES(“Fitness”, “Facebook”, “Reminders”, “Angry Birds”, “Docs”, “Buzfeed”);

INSERT INTO “TypesOfApps” (“Lifestyle”, “SocialMedia”,Utility”, “Games”, “Productivity”, “News”)
 VALUES(“Dating”, “Instagram”, “Calculator”, “Clash of Clans”, “Google Sheets”, “SmartNews”);

INSERT INTO “TypesOfApps” (“Lifestyle”, “SocialMedia”,Utility”, “Games”, “Productivity”, “News”)
 VALUES(“Food”, “Pinterest”, “Flashlight”, “Subway Surfer”, “Wallet”, “Google News”);

INSERT INTO “TypesOfApps” (“Lifestyle”, “SocialMedia”,Utility”, “Games”, “Productivity”, “News”)
 VALUES(“Music”, “Snapchat”, “Weather”, “Coin Dozer”, “Evernote”, “Feedly”);

INSERT INTO “TypesOfApps” (“Lifestyle”, “SocialMedia”,Utility”, “Games”, “Productivity”, “News”)
 VALUES(“Travel”, “Twitter”, “Calendar”, “CandyCrush”, “WunderList”, “Reddit”);

help would be greatly appreciated, this is part of a coursework.

Thank you!

UPDATE : This is the error I'm getting

Error code 30000, SQL state 42X02: Lexical error at line 1, column 13.
Encountered: "\u201c" (8220), after : "".
Line 48, column 1
5
  • can you update the question with error you are getting? Commented Apr 23, 2018 at 15:29
  • Use single quote Commented Apr 23, 2018 at 15:30
  • Doesn't work with single quotes either - I had it in single quotes but saw a similar error where people said to change to smart quotes. Commented Apr 23, 2018 at 15:31
  • Remove the quotes from around the object names - use single quotes around the vaues, and forget the smart quotes. Commented Apr 23, 2018 at 15:36
  • I doubt any computer language uses smart quotes i.e. and . Oracle uses single quotes ' for character literals such as the ones your values clause, double quotes " for nonstandard identifiers (emergency use only - not recommended) and nothing for ordinary table or column names. Commented Apr 23, 2018 at 16:01

1 Answer 1

2

Can you try this:

INSERT INTO TypesOfApps (Lifestyle, SocialMedia,Utility, Games,   Productivity, News)
VALUES('Fitness', 'Facebook', 'Reminders', 'Angry Birds', 'Docs', 'Buzfeed');

if not working, share what error you are getting.

Sign up to request clarification or add additional context in comments.

3 Comments

Also hasn't worked :Error code 30000, SQL state 42X04: Column 'Fitness' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'Fitness' is not a column in the target table. Line 48, column 1
try second one...double inverted is treated as column name...2nd should work
it has finally worked with single quotes. Thank you so much!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.