home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a039 / 4.ddi / CEXAM.ZIP / KEYADD.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-11  |  454 b   |  24 lines

  1. #include <stdio.h>
  2. #include "pxengine.h"
  3.  
  4. #define TABLENAME        "table"
  5.  
  6. FIELDHANDLE fldHandles[] = { 1, 2 };
  7.  
  8. #define NFIELDS (sizeof(fldHandles) / sizeof(FIELDHANDLE))
  9.  
  10. int main(void)
  11. {
  12.     int pxErr;
  13.  
  14.     PXInit();
  15.  
  16.     /* Create an index on fields 1 and 2 */
  17.     if ((pxErr = PXKeyAdd(TABLENAME, NFIELDS, fldHandles, PRIMARY)) 
  18.     != PXSUCCESS)
  19.         printf("%s\n", PXErrMsg(pxErr));
  20.  
  21.     PXExit();
  22.     return(pxErr);
  23. }
  24.