Delete an existing record
978995
public function deleteAction()
    {
        $model = $this->loadModel();
        if ($model->isObjectNew()) {
            $this->_forward('noroute');
            return;
        }

        try {
            $model->delete();
            $this->_redirectUrl($this->getHelper()->getGridUrl());
            $this->_getSession()->addSuccess('Deleted Successfully');
        } catch (Exception $e) {
            if ($e instanceof Zend_Db_Statement_Exception && $e->getChainedException() instanceof PDOException) {
                $e = $e->getChainedException();
            }
            Mage::logException($e);
            $this->_getSession()->addError($e->getMessage());
            $this->_redirectUrl($this->getHelper()->getEditUrl($model));
        }
    }
202072
def delete(self, record_key):

        ''' 
        '''

        title = '%s.delete' % self.__class__.__name__

    # validate inputs
        input_fields = {
            'record_key': record_key
        }
        for key, value in input_fields.items():
            object_title = '%s(%s=%s)' % (title, key, str(value))
            self.fields.validate(value, '.%s' % key, object_title)

    # validate existence of file
        file_id, parent_id = self._get_id(record_key)
        if not file_id:
            exit_msg = '%s does not exist.' % record_key
            return exit_msg
            
    # remove file
        try:
            self.drive.delete(fileId=file_id).execute()
        except:
            raise DriveConnectionError(title)

    # determine file directory
        current_dir = os.path.split(record_key)[0]
        
    # remove empty parent folders
        try:
            while current_dir:
                folder_id, parent_id = self._get_id(current_dir)
                count = 0
                for id, name, mimetype in self._list_directory(folder_id):
                    count += 1
                    break
                if count:
                    self.drive.delete(fileId=folder_id).execute()
                    current_dir = os.path.split(current_dir)[0]
                else:
                    break
        except:
            raise DriveConnectionError(title)

    # return exit message
        exit_msg = '%s has been deleted.' % record_key
        return exit_msg
186385
def delete_record(self, domain, recordid, params=None):
        ''' 
        '''
        params = update_params(params, {
            'domain': domain,
            'RECORDID': recordid
        })
        return self.request('/v1/dns/delete_record', params, 'POST')
493029
protected int remove(Connection connection, RecordStream recordStream)
            throws SQLException, IOException {
        int count = 0;
        PreparedStatement ps = statement(connection, Query.DELETE_RECORD_HASH);
        while (recordStream.hasNext()) {
            VictimsRecord vr = recordStream.getNext();
            setObjects(ps, vr.hash);
            ps.addBatch();
            count++;
        }
        executeBatchAndClose(ps);
        return count;
    }
206109
public void
removeRecord(Record r) {
	Name name = r.getName();
	int rtype = r.getRRsetType();
	synchronized (this) {
		RRset rrset = findRRset(name, rtype);
		if (rrset == null)
			return;
		if (rrset.size() == 1 && rrset.first().equals(r))
			removeRRset(name, rtype);
		else
			rrset.deleteRR(r);
	}
}
222293
def delete(self, record):
        
        index, doc_type = self.record_to_index(record)

        return self.client.delete(
            id=str(record.id),
            index=index,
            doc_type=doc_type,
        )
590552
public void doRemove() throws DBException
    {
        Object bookmark = this.getRecord().getHandle(DBConstants.BOOKMARK_HANDLE);
        String strRecordset = this.getRecord().getSQLDelete(SQLParams.USE_INSERT_UPDATE_LITERALS);
        this.executeUpdate(strRecordset, DBConstants.SQL_DELETE_TYPE);
        if (m_iRow != -1)
            m_iRow--;   // Just in case I'm in an active query this will keep requeries correct
        if (this.lockOnDBTrxType(null, DBConstants.AFTER_DELETE_TYPE, false))  // Should I do the unlock in my code?
            this.unlockIfLocked(this.getRecord(), bookmark);
    }
861548
def delete_record(self, dns_type, name):
        
        record = self.get_record(dns_type, name)
        content = self.request(
            urllib.parse.urljoin(self.api_url, self.zone['id'] + '/dns_records/' + record['id']),
            'delete'
        )
        return content['result']['id']
918279
def delete_all(self): 
        
        for record in self.find(using_name=False, data_only=True):
            res = self.delete_one(record["id"])
231784
def delete(self):
        
        try:
            if self.exists() is False:
                return None
            self.db.session.delete(self)
            self.db.session.commit()
        except (Exception, BaseException) as error:
            # fail silently
            return None
1359563
def _delete(self):
        """"""
        try:
            for record in self._records:
                try:
                    self._records[record]._delete()
                except AttributeError:
                    pass
        except AttributeError:
            pass
497189
def del_record(self, dns_record_type, host):
        """"""
        rec = self.get_record(dns_record_type, host)
        if rec:
            self._entries = list(set(self._entries) - set([rec]))
        return True
480413
public void delete(RecordId dataRecordId) {
		// search range must be a constant
		if (!searchRange.isSingleValue())
			throw new IllegalStateException();

		// delete all entry with the specific key
		while (next())
			if (getDataRecordId().equals(dataRecordId)) {
				// ccMgr.modifyLeafBlock(currentPage.currentBlk());
				delete(currentSlot);
				break;
			}

		if (!isOverflowing) {
			/*
			 * If the current regular block is empty or the key of the first
			 * record is not equal to that of records in overflow blocks,
			 * transfer one record from a overflow block to here (if any).
			 */
			if (getOverflowFlag(currentPage) != -1) {
				// get overflow page
				BlockId blk = new BlockId(currentPage.currentBlk().fileName(), getOverflowFlag(currentPage));
				ccMgr.modifyLeafBlock(blk);
				BTreePage overflowPage = new BTreePage(blk, NUM_FLAGS, schema, tx);

				SearchKey firstKey = getKey(currentPage, 0, keyType.length());
				if ((currentPage.getNumRecords() == 0
						|| (overflowPage.getNumRecords() != 0
						&& getKey(overflowPage, 0, keyType.length()) != firstKey))) {
					overflowPage.transferRecords(overflowPage.getNumRecords() - 1,
							currentPage, 0, 1);
					// if the overflow block is empty, make it a dead block
					if (overflowPage.getNumRecords() == 0) {
						long overflowFlag = (getOverflowFlag(overflowPage)
								== currentPage.currentBlk().number())
								? -1 : getOverflowFlag(overflowPage);
						setOverflowFlag(currentPage, overflowFlag);
					}
					overflowPage.close();
				}
			}
		} else {
			/*
			 * If the current overflow block is empty, make it a dead block.
			 */
			if (currentPage.getNumRecords() == 0) {
				// reset the overflow flag of original page
				BlockId blk = new BlockId(currentPage.currentBlk().fileName(), moveFrom);
				// ccMgr.modifyLeafBlock(blk);
				BTreePage prePage = new BTreePage(blk, NUM_FLAGS, schema, tx);
				long overflowFlag = (getOverflowFlag(currentPage) == prePage.currentBlk().number()) ? -1
						: getOverflowFlag(currentPage);
				setOverflowFlag(prePage, overflowFlag);
				prePage.close();
			}
		}
	}
797139
def delete(self,removed):
        
        sql = "DELETE FROM %s " %self.name
        if isinstance(removed,dict):
            # remove a single record
            _id = removed['__id__']
            sql += "WHERE rowid = ?"
            args = (_id,)
        else:
            # convert iterable into a list (to be able to sort it)
            removed = [ r for r in removed ]
            if not removed:
                return 0
            args = [ r['__id__'] for r in removed ]
            sql += "WHERE rowid IN (%s)" %(','.join(['?']*len(args)))
        self.cursor.execute(sql,args)
        return len(removed)
132519
def delete(options = {:hard => false})
      if options[:hard]
        self.class.delete(self.id, options)
      else
        return if new_record? or destroyed?
        update_column kakurenbo_column, current_time_from_proper_timezone
      end
    end
808163
def delete(record)
      load
      raise InvalidRecord, "#{record.class} does not have a valid :id!" if record.id.empty?
      @collection.delete record
    end
879111
@Trace(dispatcher = true)
	public void removeRecord(Long recordId) throws GloboDnsException {
		NewRelic.setTransactionName(null, "/globodns/removeRecord");
		if (recordId == null) {
			throw new GloboDnsException("Record id cannot be null");
		}
		
		GloboDnsRoot<Record> globoDnsRoot = this.delete("/records/" + recordId + ".json", false);
		if (globoDnsRoot == null) {
			throw new GloboDnsException("Invalid response");
		}
		return;	
	}