Sorry to repost...
Posted in 1996
Topics: General Discussion
I'm sorry to repost, but I didn't get any response to these four questions. 1) Subject: To isstart or not to isstart ? That is the question. ---------------------------------------------------------------- I want to read a C-ISAM database, from the beginning to the end, in primary key order. I will achieve this with a series of isread(..., ISNEXT). Since I'm using primary key, I know that it is the active key just after isopen(). What I don't know is whether the isopen() induces an implicit isstart(..., ISFIRST). If the answer is yes, then I can immediately use an isread(..., ISNEXT). But if the answer is no, then I must either call isstart(..., ISFIRST) or isread(..., ISFIRST) prior to the first isread(..., ISNEXT). Who knows ? 2) Subject: behaviour of isread() after isdelcurr() --------------------------------------------------- The C-ISAM Programmer's Manual states for isread() function: 9. If you use isread with ISCURR or ISNEXT after you have added a record with iswrite, isread returns the record that you just added. Fine. But what does it return if I use isread with ISNEXT or ISPREV after I have deleted a record with isdelcurr ? I would expect it to return the record that was following (respectively preceeding) the record that I just deleted. Can I assume this behaviour ? 3) Subject: Keys in descending order ------------------------------------ With ISDESC in the kp_type field of a keypart structure, we can put this part of the key in descending order. It changes the behaviour of isread with the ISNEXT or ISPREV option. Does it also change the behaviour of isread with the ISGREAT or ISGTEQ option ? 4) Subject: Asking confirmation ------------------------------- Sorry if I keep posting questions even though there are already three pending ones. I am quite in a hurry... I think I already know the answer to the present questions, but I just want to be sure. I would be very grateful if someone could confirm or contradict my suppositions. I want to delete all records that have a certain value in 'len' first bytes of the key. I consider three ways of doing that. (1) while (isstart(fd, &key, len, rec, ISEQUAL) == 0) { isread(fd, rec, ISCURR); isdelcurr(fd); } (2) while (isstart(fd, &key, len, rec, ISEQUAL) == 0) { isdelrec(fd, isrecnum); } (3) while (isstart(fd, &key, len, rec, ISEQUAL) == 0) { isdelcurr(fd); } I think that (1) is ok but it needs three C-ISAM calls for each delete and I would like to minimize the calls. My understanding of Notes 10 and 11 in isstart reference (page 8-69 in the Programmer's Manual) is that (2) is ok because isstart sets isrecnum to the starting record number, but (3) is bad because the contents of the current record do not change. Any idea? Am I right or wrong for each of (1), (2) and (3) suppositions ? Or maybe I am in the wrong way and there is a smarter method ? Thank you for any response. -- \\\\\\\\ //// (o o) (o o) +----------oOO--(_)--OOo--------------------oOO--(_)--OOo----------+ | mailto:O.Miakinen@frcl.bull.fr Phone: 33 (1) 30 80 70 42 | | http://www-ism.bull.com/ism Fax: 33 (1) 30 80 79 18 | +-------------(_)-(_)--------------------------(_)-(_)-------------+