Update table records using optional conditions. Example:

   plsql.employees.update(:first_name => 'Second', :where => {:employee_id => 1})
   # => UPDATE employees SET first_name = 'Second' WHERE employee_id = 1
546314
def update(params)
      raise ArgumentError, "Only Hash parameter can be passed to table update method" unless params.is_a?(Hash)
      where = params.delete(:where)

      table_proc = TableProcedure.new(@schema, self, :update)
      table_proc.add_set_arguments(params)
      table_proc.add_where_arguments(where) if where
      call = ProcedureCall.new(table_proc, table_proc.argument_values)
      call.exec
    end
255287
def update_sql(table, filter, updates):
    '''
    
    '''
    where_keys, where_vals = _split_dict(filter)
    up_keys, up_vals = _split_dict(updates)
    changes = _pairs(up_keys, sep=', ')
    where = _pairs(where_keys, start=len(up_keys) + 1)
    sql = 'UPDATE {} SET {} WHERE {}'.format(
        table, changes, where)
    return sql, up_vals + where_vals
1004536
function update(instance, array, tx, callback) {
    var
        model = instance.__model,
        beforeUpdate = model.__beforeUpdate,
        updates,
        params,
        sql;
    if (beforeUpdate) {
        beforeUpdate(instance);
    }
    if (!array) {
        array = model.__updateAttributesArray;
    }
    updates = _.map(array, function (attr) {
        return '`' + attr + '`=?';
    });
    params = _.map(array, function (attr) {
        return instance[attr];
    });
    params.push(instance[model.__primaryKey]);
    sql = utils.format('update `%s` set %s where `%s`=?', model.__table, updates.join(', '), model.__primaryKey);
    smartRunSQL(model.__pool, sql, params, tx, function (err, result) {
        if (err) {
            return callback(err);
        }
        callback(null, instance);
    });
}
1210772
def update(options={}, &block)
      object = resource

      if update_resource(object, resource_params)
        options[:location] ||= smart_resource_url
      end

      respond_with_dual_blocks(object, options, &block)
    end
1047127
def update_object_in_db(self,
                            obj: Any,
                            table: str,
                            fieldlist: Sequence[str]) -> None:
        """"""
        self.ensure_db_open()
        pkvalue = getattr(obj, fieldlist[0])
        valuelist = []
        # Non-PK fields first
        for f in fieldlist[1:]:
            valuelist.append(getattr(obj, f))
        # Then PK
        valuelist.append(pkvalue)
        cursor = self.db.cursor()
        self.db_exec_with_cursor(
            cursor,
            get_sql_update_by_first_field(table, fieldlist, self.get_delims()),
            *valuelist
        )
433571
def update(name,type,ttl,values,comment=nil, zone_apex = nil)
      prev = self.clone
      @name = name unless name.nil?
      @type = type unless type.nil?
      @ttl = ttl unless ttl.nil?
      @values = values unless values.nil?
      @zone_apex = zone_apex unless zone_apex.nil?
      @zone.perform_actions([
          {:action => "DELETE", :record => prev},
          {:action => "CREATE", :record => self},
          ],comment)
    end
611280
def update(self,record,**kw):
        """"""
        vals = self._make_sql_params(kw)
        sql = "UPDATE %s SET %s WHERE rowid=?" %(self.name,
            ",".join(vals))
        self.cursor.execute(sql,kw.values()+[record['__id__']])
273834
def update_record(self, common_name, **fields):
        """"""

        record = self.get_record(common_name)
        if fields is not None:
            for field, value in fields:
                record[field] = value
        self.save()
        return record
636988
def refresh(self, fields=None, **kwargs):
        
        cond = self.c[self._primary_field]==self._key
        query = self.filter(cond, **kwargs)
        if not fields:
            fields = list(self.table.c)
        
        v = query.values_one(*fields)
        if not v:
            raise NotFound('Instance <{0}:{1}> can not be found'.format(self.tablename, self._key))
        
        d = self._data_prepare(v.items())
        self.update(**d)
        self.set_saved()
250821
def update(self):
        """"""
        ret = True
        fields = self.depopulate(True)
        q = self.query
        q.set_fields(fields)

        pk = self.pk
        if pk:
            q.is_field(self.schema.pk.name, pk)

        else:
            raise ValueError("You cannot update without a primary key")

        if q.update():
            fields = q.fields
            self._populate(fields)

        else:
            ret = False

        return ret
155957
def update(self, columns=(), by=(), where=(), **kwds):
        
        return self._seu('update', columns, by, where, kwds)
203158
def update(self, instance, condition):
        
        item = self.dbi.get(condition)
        if item is None:
            return None
        item.update(instance.as_dict())
        self.dbi.update(item, condition)
        return item.eid
1332078
def _update_record(self, identifier, rtype=None, name=None, content=None):
        """"""
        record = {}

        if not identifier:
            records = self._list_records(rtype, name, content)
            identifiers = [r["id"] for r in records]
        else:
            identifiers = [identifier]

        if name:
            record["name"] = self._relative_name(name)
        if content:
            record["content"] = content
        if self._get_lexicon_option('ttl'):
            record["ttl"] = self._get_lexicon_option('ttl')
        if self._get_lexicon_option('priority'):
            record["prio"] = self._get_lexicon_option('priority')

        LOGGER.debug("update_records: %s", identifiers)

        for record_id in identifiers:
            self._put(
                "/v1/domains/{0}/records/{1}".format(
                    self.domain, identifier
                ),
                record,
            )
            LOGGER.debug("update_record: %s", record_id)

        LOGGER.debug("update_record: %s", True)
        return True
1146879
def update(sql, *args, **kwargs):
        
        assert "update" in sql.lower(), 'This function requires an update statement, provided: {}'.format(sql)
        cursor = CoyoteDb.execute_and_commit(sql, *args, **kwargs)

        # now get that id
        last_row_id = cursor.lastrowid

        return last_row_id
705777
def update(self, *, name=None, position=None, visibility=None):
        

        if name is None and position is None and visibility is None:
            raise ValueError('Provide at least one parameter to update')
        data = {}
        if name:
            data['name'] = name
        if position:
            data['position'] = position
        if visibility:
            data['visibility'] = visibility

        response = self.session.patch(self.build_url(''), data=data)
        if not response:
            return False

        data = response.json()
        self.name = data.get('name', self.name)
        self.position = data.get('position', self.position)
        self.visibility = data.get('visibility', self.visibility)

        return True
786903
def _todo_do_update(self, line):
        ""
        table, line = self.get_table_params(line)
        hkey, line = line.split(" ", 1)
        expected, attr = self.get_expected(line)

        if attr[0] == '-':
            op, attr = attr.split(" ", 1)
            op = op[1]
        else:
            op = "u"

        if attr[0] == '+':
            ret, attr = attr.split(" ", 1)
            ret = ret[1:]
        else:
            ret = "ALL_NEW"

        if ',' in hkey:
            hkey, rkey = hkey.split(",", 1)
        else:
            rkey = None

        item = table.new_item(hash_key=self.get_typed_key_value(table, hkey), range_key=self.get_typed_key_value(table, rkey, False))

        attr = json.loads(attr.strip())
        for name in attr.keys():
            value = attr[name]
            if isinstance(value, list):
                value = set(value)

            if op == 'a':
                item.add_attribute(name, value)
            elif op == 'd':
                item.delete_attribute(name, value)
            else:
                item.put_attribute(name, value)

        self.pprint(item)
        updated = item.save(expected_value=expected or None, return_values=ret)
        self.pprint(updated)

        if self.consumed:
            print "consumed units:", item.consumed_units
75665
public Optional<NrqlAlertCondition> update(NrqlAlertCondition condition)
    {
        return HTTP.PUT(String.format("/v2/alerts_nrql_conditions/%d.json", condition.getId()), condition, NRQL_ALERT_CONDITION);
    }