0

I'm attempting to import a .sql file into a phpMyAdmin table.

the above error is uncanny as it looks as though its stopped at the `R"? part of my file.

I have attached a screenshot and also the file i'm trying to import. Any help would me much appreciated.

enter image description here

INSERT INTO `tallmanc_TestApi`.`WeeklySchedule`
    (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`)
    VALUES (`1`,`0`,`0`,`24`,`TestData`)

INSERT INTO `tallmanc_TestApi`.`WeeklySchedule`
    (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`)
    VALUES (`2`,`1`,`1`,`22`,`TestData`)

INSERT INTO `tallmanc_TestApi`.`WeeklySchedule`
    (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`)
    VALUES (`3`,`2`,`2`,`8`,`TestData`)

INSERT INTO `tallmanc_TestApi`.`WeeklySchedule`
    (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`)
    VALUES (`4`,`3`,`3`,`21`,`TestData`)

INSERT INTO `tallmanc_TestApi`.`WeeklySchedule`
    (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`)
    VALUES (`5`,`1`,`0`,`24`,`TestData`)

INSERT INTO `tallmanc_TestApi`.`WeeklySchedule`
    (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`)
    VALUES (`6`,`2`,`1`,`8`,`TestData`)

INSERT INTO `tallmanc_TestApi`.`WeeklySchedule`
    (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`)
    VALUES (`7`,`3`,`2`,`20`,`TestData`)

INSERT INTO `tallmanc_TestApi`.`WeeklySchedule`
    (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`)
    VALUES (`8`,`4`,`3`,`32`,`TestData`)

INSERT INTO `tallmanc_TestApi`.`WeeklySchedule`
    (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`)
    VALUES (`9`,`2`,`0`,`7`,`TestData`)

INSERT INTO `tallmanc_TestApi`.`WeeklySchedule`
    (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`)
    VALUES (`10`,`3`,`1`,`22`,`TestData`)

INSERT INTO `tallmanc_TestApi`.`WeeklySchedule`
    (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`)
    VALUES (`11`,`4`,`2`,`25`,`TestData`)

INSERT INTO `tallmanc_TestApi`.`WeeklySchedule`
    (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`)
    VALUES (`12`,`5`,`3`,`21`,`TestData`)

INSERT INTO `tallmanc_TestApi`.`WeeklySchedule`
    (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`)
    VALUES (`13`,`3`,`0`,`30`,`TestData`)

INSERT INTO `tallmanc_TestApi`.`WeeklySchedule`
    (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`)
    VALUES (`14`,`4`,`1`,`25`,`TestData`)
Shadow
  • 33,525
  • 10
  • 51
  • 64
  • your query should --INSERT INTO tallmanc_TestApi.WeeklySchedule (Id, Day_Id, Meal_Type, RecipeId, Schedule_Type) VALUES (2,1,1,22,'TestData');INSERT INTO tallmanc_TestApi.WeeklySchedule (Id, Day_Id, Meal_Type, RecipeId, Schedule_Type) VALUES (3,1,1,22,'TestData2'); – Abhijit Jagtap Oct 26 '16 at 08:32
  • You simply lack the semicolon between sql commands, I'd say. – arkascha Oct 26 '16 at 08:35
  • @TallManCycles just to help you with debugging MySQL errors in the future: it is the **start** of the sql code excerpt that indicates where MySQL encountered an error, not the end of it. So, the indicated error message does not mean that it stopped processing at ``R. It indicates that MySQL has a problem with the `insert` keyword at the beginning of the code excerpt. – Shadow Oct 26 '16 at 08:43

1 Answers1

0

Back-ticks are primarily used for table and column identifiers. And are necessary only if the identifiers contain white spaces or MySQL Reserved Words. Single quotes are used for enclosing string literals in the VALUES() list. Though MySQL supports double quotes, single quotes are more widely accepted across all RDBMSs. Hence it’s a good practice to enclose the values within single quotes.

MySQL expects DATE and DATETIME literal values to be enclosed within single quotes(though double quotes works fine).

So if the table & column identifiers don’t contain any special characters apart from [a-z,A-Z,0-9,$_], you can leave them unquoted. The string literal values in VALUES() list must be enclosed within single quotes. You can use double quotes to enclose single quotes(‘).

check here When to use single quotes, double quotes, and backticks in MySQL or Using backticks around field names

Try this queries in phpmyadmin..to last column you should wrap with quote and give semicolon at the end of each statement.

INSERT INTO tallmanc_TestApi.WeeklySchedule (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`) VALUES (2,1,1,22,'TestData'); 
INSERT INTO tallmanc_TestApi.WeeklySchedule (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`) VALUES (3,2,2,8,'TestData'); 
INSERT INTO tallmanc_TestApi.WeeklySchedule (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`) VALUES (4,3,3,21,'TestData'); 
INSERT INTO tallmanc_TestApi.WeeklySchedule (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`) VALUES (5,1,0,24,'TestData'); 
INSERT INTO tallmanc_TestApi.WeeklySchedule (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`) VALUES (6,2,1,8,'TestData'); 
INSERT INTO tallmanc_TestApi.WeeklySchedule (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`) VALUES (7,3,2,20,'TestData'); 
INSERT INTO tallmanc_TestApi.WeeklySchedule (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`) VALUES (8,4,3,32,'TestData'); 
INSERT INTO tallmanc_TestApi.WeeklySchedule (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`) VALUES (9,2,0,7,'TestData'); 
INSERT INTO tallmanc_TestApi.WeeklySchedule (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`) VALUES (10,3,1,22,'TestData'); 
INSERT INTO tallmanc_TestApi.WeeklySchedule (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`) VALUES (11,4,2,25,'TestData'); 
INSERT INTO tallmanc_TestApi.WeeklySchedule (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`) VALUES (12,5,3,21,'TestData'); 
INSERT INTO tallmanc_TestApi.WeeklySchedule (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`) VALUES (13,3,0,30,'TestData'); 
INSERT INTO tallmanc_TestApi.WeeklySchedule (`Id`, `Day_Id`, `Meal_Type`, `RecipeId`, `Schedule_Type`) VALUES (14,4,1,25,'TestData');
Community
  • 1
  • 1
Abhijit Jagtap
  • 2,740
  • 2
  • 29
  • 43
  • While the above code may solve the issue described in the question, the answer would be a lot more useful if you explained what and why you changed in the code. – Shadow Oct 26 '16 at 08:39
  • Wow, that's what I was missing! Thank you all who answered! Absolutely amazing. – TallManCycles Oct 26 '16 at 10:29