def createTableGroup(name): db = DBINT.getPWDataBase('DB1') query = ''' CREATE TABLE %s ( id INT NOT NULL PRIMARY KEY, height INT, weight INT, maritalstatus INT, physicalstatus INT, complexion INT, religion INT, caste INT, countryperm INT, stateperm INT, districtperm INT, placeperm VARCHAR(100), pinperm INT, countrytemp INT, statetemp INT, districttemp INT, placetemp VARCHAR(100), pintemp INT, education INT, occupationtype INT, occupation INT, company VARCHAR(50), companyemail VARCHAR(50), writtenby INT, aboutme TEXT ) '''%name cursor = db.connect() cursor.execute(query) db.disconnect()
def deleteTableGroup(name): db = DBINT.getPWDataBase('DB1') cursor = db.connect() query = ''' DROP TABLE %s '''%name cursor.execute(query) db.disconnect()
def createDebugTable(): db = DBINT.getPWDataBase('DB1') query = ''' CREATE TABLE %s ( bugid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, id INT, placemarker VARCHAR(30), remark TEXT, status VARCHAR(10) ) '''%('debuginfo') cursor = db.connect() cursor.execute(query) db.disconnect() print 'created debuginfo'
def createCompanyTable(): db = DBINT.getPWDataBase('DB1') query = ''' CREATE TABLE %s ( id INT NOT NULL PRIMARY KEY, name VARCHAR(100), maildomain VARCHAR(100), type VARCHAR(10), status VARCHAR(10), url VARCHAR(100), info TEXT ) '''%('companydetails') cursor = db.connect() cursor.execute(query) db.disconnect()