Database>Deleting records
Introduction Installation Beginning Admin Quick Ref FTP Server SMTP Server Database Security
Statements Objects String Parsing Events Queues Samples Special names Error Handling Accessories   Back
Caravan Business Server>Help>Database>Deleting records
Syntax <caravan>table connection instance name(deleterecord)</caravan>
Text To delete an entire record, first position the current record pointer recordno to the record you want to remove, then use the deleterecord keyword. The record number may be passed from a form or may be a constant . The syntax is as follows: Note:The method 'deleterecord' automatically updates the recordno to the next in the set.
Sample
      Form field

      <caravan>
      table contacts = contacts.contacts
           contacts(recordno)=form(recno)      
          //form(recno) is the record number passed to the current web page by post method from a previous web  
          //page.
           contacts(deleterecord)
      </caravan>


      Constants

      <caravan>
           table contacts = contacts.contacts
           contacts(recordno)="3"
           // go to record number 3
           contacts(deleterecord)
      </caravan>


      Deleting a record set based on search condition

      <caravan>
           table contacts = contacts.contacts
           select from contacts where company=1 and firstname=john and lastname=minolta
           contacts(deleterecord)

       </caravan>
Quick Reference
Home       Back