home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Product / Product.zip / viper092.zip / DELREC.CMD < prev    next >
OS/2 REXX Batch file  |  1995-09-20  |  1KB  |  46 lines

  1. /*      VIPER Database Engine
  2.         Delete a database record example.
  3.         Copyright (c) - 1995 by Douglas A. Bebber
  4. */
  5.  
  6.  
  7. /* Register the VIPER Database Engine functions... */
  8. rc = RxFuncAdd("SysLoadViperFuncs","Viper", "SysLoadViperFuncs")
  9. call SysLoadViperFuncs
  10.  
  11. /* OPEN THE DATABASE */
  12. status = RxViperOpenDatabase('CUSTOMER')
  13. if status = 0 then
  14. Do
  15.         say 'Failed to open CUSTOMER database!'
  16.         exit
  17. End
  18. else
  19.         say 'Successfully opened CUSTOMER database!'
  20.  
  21.  
  22. /* MOVE TO FIRST RECORD */
  23.  
  24. status = RxViperMoveToFirstRecord('CUSTOMER', 'LNAME')
  25. say 'Moving to first record in the database...'
  26.  
  27. /* DELETE THE RECORD */
  28.  
  29. status = RxViperDeleteRecord('CUSTOMER', 'LNAME')
  30. if status = 0 then
  31.         say 'Failed to delete the database record!'
  32. else
  33.         say 'Successfully deleted the database record!'
  34.  
  35. /* CLOSE THE DATABASE */
  36.  
  37. status = RxViperCloseDatabase('CUSTOMER')
  38. if status = 0 then
  39. Do
  40.         say 'Failed to close CUSTOMER database!'
  41.         exit
  42. End
  43. else
  44.         say 'Successfully closed CUSTOMER database!'
  45.  
  46.