home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: Product
/
Product.zip
/
viper092.zip
/
DBINFO.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-09-20
|
2KB
|
71 lines
/* VIPER Database Engine
Get database structure information 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!'
/* GET NUMBER OF FIELDS */
NFields = RxViperGetNFields('CUSTOMER')
say 'Database has 'NFields' fields.'
/* GET FIELD NAMES */
say 'Database Field Names:'
status = RxViperGetFieldNames('CUSTOMER', FieldNames.)
if status = 1 then
do
do index = 1 to FieldNames.0
say FieldNames.index
end
end
/* GET INDEX INFO */
status = RxViperGetIndexNames('CUSTOMER', IndexNames.)
if status = 1 then
Do
say 'Database has 'IndexNames.0' indexes:'
say ' '
do index = 1 to IndexNames.0
say IndexNames.index' defined as:'
status = RxViperGetIndexDescription('CUSTOMER', IndexNames.index, Info.)
if status = 1 then
do
do idex = 1 to Info.0
say Info.idex
end
end
say ' '
end
End
/* 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