home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: Product
/
Product.zip
/
viper092.zip
/
UPDATREC.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-09-20
|
1KB
|
57 lines
/* VIPER Database Engine
Read a record and move within a database example.
Copyright (c) - 1995 by Douglas A. Bebber
*/
/* Register the VIPER Database Engine functions... */
rc = RxFuncAdd("SysLoadViperFuncs","Viper", "SysLoadViperFuncs")
call SysLoadViperFuncs
/* OPEN THE DATABASE */
status = RxViperOpenDatabase('CUSTOMER')
if status = 0 then
Do
say 'Failed to open CUSTOMER database!'
exit
End
else
say 'Successfully opened CUSTOMER database!'
/* MOVE TO FIRST RECORD */
status = RxViperMoveToFirstRecord('CUSTOMER', 'LNAME')
say 'Moving to first record in the database...'
/* GET A RECORD AND DISPLAY IT */
status = RxViperGetRecord('CUSTOMER', 'LNAME', Fields.)
if status = 1 then
do
do index = 1 to Fields.0
say Fields.index
end
end
else
say status
/* CHANGE THE RECORD AND UPDATE IT */
Fields.5 = '1212 West Lake Drive - Apt. 1A'
status = RxViperUpdateRecord('CUSTOMER', 'LNAME', Fields.)
if status = 0 then
say 'Failed to update the record!'
else
say 'Successfully updated the record!'
/* CLOSE DATABASE */
status = RxViperCloseDatabase('CUSTOMER')
if status = 0 then
say 'Failed to close the CUSTOMER database!'
else
say 'Successfully closed the CUSTOMER database!'
call SysDropFuncs