def persist(self): sql = "INSERT INTO `asd`.`employees` VALUES \ ('" + self.EmployeeID + "', '" + self.LastName + "', '" + self.FirstName + "', '" + self.Title + "', '" + self.TitleOfCourtesy\ + "', '" + self.BirthDate + "', '" + self.HireDate + "', '" + self.Address + "', '" + self.City + "', '" \ + self.Region + "', '" + self.PostalCode + "', '" + self.Country + "', '" + self.HomePhone\ + "', '" + self.Extension + "', '" + self.Photo + "', '" + self.Notes + "', '" \ + self.ReportsTo + "', '" + self.PhotoPath + "', '" + self.Salary + "');" print(sql) Functions.sql_executer(sql)
def caller(self): datas = Functions.data_reader("employees.csv") for i in range(1, len(datas)): employee = Employee.parse(datas[i]) employee.persist()
def persist(self): sql = "INSERT INTO `asd`.`orderdetails` (`OrderID`, `ProductID`, `UnitPrice`, `Quantity`, `Discount`) VALUES \ ('" + self.OrderID + "', '" + self.ProductID + "', '" + self.UnitPrice + "', '" + self.Quantity + "', '" + self.Discount + "');" Functions.sql_executer(sql)
def caller(self): datas = Functions.data_reader("order_datails.csv") for i in range(1, len(datas)): order_detail = Order_Detail.parse(datas[i]) order_detail.persist()
def persist(self): sql = "INSERT INTO `asd`.`customers` (`CustomerID`, `CompanyName`, `ContactName`, `ContactTitle`, `Address`, `City`, `Region`, `PostalCode`, `Country`, `Phone`, `Fax`) VALUES \ ('" + self.customerid + "', '" + self.companyname + "', '" + self.contactname + "', '" + self.contacttitle + "', '" + self.address + "', '" + self.city + "', '" + self.region + "', '" + self.postalcode + "', '" + self.country + "', '" + self.phone + "', '" + self.fax + "');" Functions.sql_executer(sql)
def caller(self): datas = Functions.data_reader("customers.csv") for i in range(1, len(datas)): customer = Customer.parse(datas[i]) customer.persist()
def caller(self): datas = Functions.data_reader((self.Filename)) for i in range(1, len(datas)): order = OrmTest.parse(datas[0], datas[i]) order.persist()
def persist(self): print(self.sql) Functions.sql_executer(self.sql)