- /* The following is declarative, not executed,
- * and so is dependent on where it is in the file,
- * not in the order of execution of statements.
- */
- EXEC SQL WHENEVER SQLERROR GOTO sqlerr;
-
- EXEC SQL DECLARE x CURSOR FOR
- SELECT u.login, u.clearid, u.signature, u.sigdate, s.string, u.sigwho
- FROM users u, strings s
- WHERE u.status = 1 and u.sigwho = s.string_id;
- EXEC SQL OPEN x;
- while (1) {
- EXEC SQL FETCH x INTO :login, :id, :sig, :timestamp, :kname, :sigwho;
- if (sqlca.sqlcode != 0) break;
- if (id == 0) continue;
- if (!isdigit(id[1])) continue;
- strtrim(login);
- strtrim(id);
- strtrim(kname);
- memset(&outrec, 0, sizeof(outrec));
- strcpy(outrec.login, login);
- strcpy(outrec.id, id);
- if (sigwho) {
- si.timestamp = timestamp;
- si.SigInfoVersion = 0; /* XXXXXX this isn't used */
- kname_parse(si.pname, si.pinst, si.prealm, kname);
- si.rawsig = (unsigned char *)sig;
- GDSS_Recompose(&si, outrec.sig);
- }
- write(out, &outrec, sizeof(outrec));
+ /* The following is declarative, not executed,
+ * and so is dependent on where it is in the file,
+ * not in the order of execution of statements.
+ */
+ EXEC SQL WHENEVER SQLERROR GOTO sqlerr;
+
+ EXEC SQL DECLARE x CURSOR FOR
+ SELECT login, clearid, first, last, middle
+ FROM users
+ WHERE (status = 1 or status = 2 or status = 5 OR
+ status = 6 or status = 7 or status = 9);
+ EXEC SQL OPEN x;
+ while (1)
+ {
+ EXEC SQL FETCH x INTO :login, :id, :fname, :lname, :middle;
+ if (sqlca.sqlcode)
+ break;
+ if (id == 0)
+ continue;
+ if (!isdigit(id[1]))
+ continue;
+ strtrim(login);
+ strtrim(id);
+ strtrim(fname);
+ strtrim(lname);
+ strtrim(middle);
+ memset(&outrec, 0, sizeof(outrec));
+ strcpy(outrec.login, login);
+ strcpy(outrec.id, id);
+ strcpy(outrec.fname, fname);
+ strcpy(outrec.lname, lname);
+ strcpy(outrec.middle, middle);
+ write(out, &outrec, sizeof(outrec));
+ records++;