swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Topics   Other Library Functions  
function  

db.delete

 
 

Library: Database access (OMDB)
Import: omdb.xmd

Declaration

define external function db.delete
 from  value    db.table  table
 where value    stream   condition

Argument definitions

table
is an open db.table object.
condition
is a condition to limit the number of rows deleted.


Purpose

Use db.delete to delete records from a table using the supplied criteria.

Requirements

The condition must be

Usage Notes

None.

Example

The following example uses db.delete to remove grade references for students who did not finish a course. The deletion is performed through the db.table OMX component.

  import "omdb.xmd" prefixed by db.
  
  process
      local db.database this-db
      local db.table student-course
  
      ;  create the database OMX objects
      set this-db to db.open-odbc 'dbDemo'
      set student-course to db.open-table in this-db named 'StudentCourse'
  
      ;  drop students who did not finish from course lists
      db.delete from student-course where "Grade is NULL"
  
      ;  catch the database exceptions
      catch #external-exception identity catch-id message catch-msg
          output 'An error occurred while accessing an OMDB function.%n'
          output '%g(catch-id)  :  %g(catch-msg)%n'

    Related Topics
 
Other Library Functions
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:38:10 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.