Re: informix C_ISAM ??
Posted in 1995
Here's are some things to look for: 1. You define the key variable using _key_; however, you use _pkey_ in _isstart_ (This may be it!) : struct keydesc key ; --- : if(isstart(fd,&pkey,0,&in,ISGTEQ) != 0) { ----- 2. It has been a while, but I remember using the isindexinfo function to retrieve key descriptors, instead of hard-coding them in a program: error = isindexinfo(fd, &key, keynum) /* replace keynum with 2 or appropiate value. */ 3. bcheck the file (maybe you have a corrupt second second index) Catalin _____ _____ _____ _____ _ _ _____ Catalin Badea _____/ _____/ _____/ _____/ _/_ _/ _____/ Senior Technical Architect _/ _/___ _/ _/____ _/_/ _/____ Tecsys Inc. _/ ____/ _/ _____/ _/ _____/ _/ _/____ _/___ ____/ _/ ____/ cat@tecsys.com _/ _____/ _____/ _____/ _/ _____/ include system "disclaim.4gh" Special system engineer (lees@iiidns.iii.org.tw) wrote: : I am using informix C_ISAM library retrieve records via secondary Key. : This isam file is 25 bytes for each record, Primary Key offset is 0, : length is 25 bytes, Secondary Key offset is 12 bytes, length is 7 bytes. : : My key descriptor as follows : : : struct keydesc key ; : char in[25] ; : key.k_flags = ISDUPS; : key.k_nparts = 1; : key.k_part[0].kp_start = 12 ; : key.k_part[0].kp_leng = 7 ; : key.k_part[0].kp_type = CHARTYPE ; : memcpy(in, "0840211", 7) ; : if(isstart(fd,&pkey,0,&in,ISGTEQ) != 0) { : printf("\\nstart read error <NO> %d\\n", iserrno) ; : } : : if (isread(fd,&in,ISNEXT) == -1) { : printf("\\nread current data error <NO> %d\\n",iserrno) ; : return ; : } : There are four records match this second key but I can't retieve one of them. : Is there anything with my key descriptor declaration or my syntax ? : Any help or comments are welcome ... : Thank in advance. --