def doSQLUpdate(sqlString)
   
      sql = sqlString.dup
      dbname = ""
      state = nil
      fieldName = ""
      fieldValue = ""
      sqlQuery = "SELECT 3 FROM "
      
      clearFieldValuePairList

      sql.split(' ').each{ |token|
         case token
            when "UPDATE" 
               state = "getTable" unless state == "getFilter"
               next
            when "SET" 
               state = "getFieldName"  unless state == "getFilter"
               next
            when "=" 
               sqlQuery << " = " if state == "getFilter"
               state = "getFieldValue" unless state == "getFilter"
               next
            when "WHERE" 
               sqlQuery << " WHERE "
               state = "getFilter"
               next
         end
         if state == "getTable"
            dbname = token.dup
            sqlQuery << dbname
         elsif state  == "getFieldName" 
            fieldName = token.gsub('[','').gsub(']','')
         elsif state  == "getFieldValue" 
            test = token
            if test[-1,1] == "'" or test[-2,2] == "',"
               fieldValue << token
               if fieldValue[-2,2] == "',"
                  state = "getFieldName"
                  fieldValue.gsub!("',","")
               end
               fieldValue.gsub!("'","")
               if fieldName.length > 0 
                  addFieldValuePair(fieldName,nil,nil,fieldValue)
                  fieldName = ""
                  fieldValue = ""
               end
            else   
               fieldValue << "#{token} "
            end
         elsif state == "getFilter"   
            sqlQuery << token
         end
      }
      
      rows = doSQLQuery(sqlQuery,:Array)
      if rows and @dbid and @fvlist
         idFieldName = lookupFieldNameFromID("3")
         rows.each{ |row|
            recordID = row[idFieldName]
            editRecord(@dbid,recordID,@fvlist) if recordID
         }
      end
      
   end
def doSQLUpdate(sqlString)
   
      sql = sqlString.dup
      dbname = ""
      state = nil
      fieldName = ""
      fieldValue = ""
      sqlQuery = "SELECT 3 FROM "
      
      clearFieldValuePairList

      sql.split(' ').each{ |token|
         case token
            when "UPDATE" 
               state = "getTable" unless state == "getFilter"
               next
            when "SET" 
               state = "getFieldName"  unless state == "getFilter"
               next
            when "=" 
               sqlQuery << " = " if state == "getFilter"
               state = "getFieldValue" unless state == "getFilter"
               next
            when "WHERE" 
               sqlQuery << " WHERE "
               state = "getFilter"
               next
         end
         if state == "getTable"
            dbname = token.dup
            sqlQuery << dbname
         elsif state  == "getFieldName" 
            fieldName = token.gsub('[','').gsub(']','')
         elsif state  == "getFieldValue" 
            test = token
            if test[-1,1] == "'" or test[-2,2] == "',"
               fieldValue << token
               if fieldValue[-2,2] == "',"
                  state = "getFieldName"
                  fieldValue.gsub!("',","")
               end
               fieldValue.gsub!("'","")
               if fieldName.length > 0 
                  addFieldValuePair(fieldName,nil,nil,fieldValue)
                  fieldName = ""
                  fieldValue = ""
               end
            else   
               fieldValue << "#{token} "
            end
         elsif state == "getFilter"   
            sqlQuery << token
         end
      }
      
      rows = doSQLQuery(sqlQuery,:Array)
      if rows and @dbid and @fvlist
         idFieldName = lookupFieldNameFromID("3")
         rows.each{ |row|
            recordID = row[idFieldName]
            editRecord(@dbid,recordID,@fvlist) if recordID
         }
      end
      
   end
Translate a simple SQL UPDATE statement to a QuickBase editRecord call.

 Note: This method is here primarily for Rails integration.
 Note: This assumes, like SQL, that your column (i.e. field) names do not contain spaces.
 Note: This assumes that Record ID# is the key field in your table.