Beispiel #1
0
         tempType = tempList[1]
         if tempName == "":
             print "you have to give a name of the field"
             isLegalFormat = False
             break
         if not (tempType == "STRING" or tempType == "INT" or tempType == "FLOAT"):
             print "type not valid"
             isLegalFormat = False
             break
         schemaList.append(nameAndType)
     if isLegalFormat == True:
         isLegalIndex = False
         indexColumnName = raw_input("enter the index name : ")
         if indexColumnName == "":
             env = SliceEnv()
             env.createDB(tableName, schemaList, "")
         else:
             for tempNameAndType in schemaList:
                 tempName = tempNameAndType.split("|")[0]
                 if tempName == indexColumnName:
                     isLegalIndex = True
                     break
             if isLegalIndex == False:
                 print "this index is not legal"
                 pass
             else:
                 env.createDB(tableName, schemaList, indexColumnName)
     else:
         continue
 elif instruction == 2:
     tableName = raw_input("plase enter table name : ")