(self, tk, fields, values, key_fields, key_values)
Handler for updates.
Handler for updates.
Handler for updates .
def parse_update(self, tk, fields, values, key_fields, key_values):
        """Handler for updates."""
        # col1 = 'data1', col2 = null where pk1 = 'pk1' and pk2 = 'pk2'
        while 1:
            fields.append(tk.next())
            if tk.next() != "=":
                raise Exception("syntax error")
            values.append(tk.next())
            t = tk.next()
            if t == ",":
                continue
            elif t.lower() == "where":
                break
            else:
                raise Exception("syntax error, expected WHERE or , got "+repr(t))
        while 1:
            fld = tk.next()
            key_fields.append(fld)
            self.pklist.append(fld)
            if tk.next() != "=":
                raise Exception("syntax error")
            key_values.append(tk.next())
            t = tk.next()
            if t.lower() != "and":
                raise Exception("syntax error, expected AND got "+repr(t))
def parse_update ( self , tk , fields , values , key_fields , key_values ) : # col1 = 'data1', col2 = null where pk1 = 'pk1' and pk2 = 'pk2' while 1 : fields . append ( tk . next ( ) ) if tk . next ( ) != "=" : raise Exception ( "syntax error" ) values . append ( tk . next ( ) ) t = tk . next ( ) if t == "," : continue elif t . lower ( ) == "where" : break else : raise Exception ( "syntax error, expected WHERE or , got " + repr ( t ) ) while 1 : fld = tk . next ( ) key_fields . append ( fld ) self . pklist . append ( fld ) if tk . next ( ) != "=" : raise Exception ( "syntax error" ) key_values . append ( tk . next ( ) ) t = tk . next ( ) if t . lower ( ) != "and" : raise Exception ( "syntax error, expected AND got " + repr ( t ) )