delete()

The Database.delete() function deletes a record corresponding to the concept instance in the database.

If cascade is set to true, it deletes all database records corresponding to the contained concept property references and nulls out foreign key references in database records corresponding to the concepts that refer to the concept being deleted.

Example

try
  {
   Database.setCurrentConnection ("/MyDbConnection");
   Database.beginTransaction ();
   /*the instance passed to delete operation is an instance of the    dbconcept*/
   Database.delete(instance, false)
   Database.commit();
  }
catch (Exception e)
  {
   Database.rollback();
  }
finally
  {
   Database.unsetConnection();
  }
Related reference