I've written a small script to strip "`" out of multi-line SQL queries, and every time the loop comes to the end of a line, it breaks. below is the code, and what im inserting:
inp = input('Enter Query: ')
for s in inp:
if s != '`':
print(s, end = '')
input is:
CREATE TABLE IF NOT EXISTS `mydb`.`Employees` (
`Employees_PK` INT NOT NULL,
`Employee_L_NAME` VARCHAR(45) NOT NULL,
`Employee_F_NAME` VARCHAR(45) NOT NULL,
`Employees_PHONE` VARCHAR(45) NOT NULL,
`Employee_EMAIL` VARCHAR(45) NOT NULL,
`Employee_HIRE_DATE` DATE NOT NULL,
`Employee_MANAGED_BY` INT NULL,
PRIMARY KEY (`Employees_PK`))
So the problem is that the for loop breaks after one line, and only outputs this:
CREATE TABLE IF NOT EXISTS mydb.Employees (
Any way to get around this? its not essential to preserve the structure (indents, etc.), but it would be nice