]> andersk Git - moira.git/commitdiff
New database and column names for Moira2.
authorgenoa <genoa>
Mon, 14 Sep 1992 23:21:53 +0000 (23:21 +0000)
committergenoa <genoa>
Mon, 14 Sep 1992 23:21:53 +0000 (23:21 +0000)
gen/ca.dc
gen/letter.dc
gen/mailhub.dc
gen/mitdir.dc
gen/nfs.dc
gen/passwd.dc
gen/pobox.dc
gen/prlogger.dc
gen/sis.dc
gen/stats.dc
gen/zephyr.dc

index d452559ae5339e6ec48e0a5675a64b9e661338cf..9a93eb476992a524e23a0bc4bc6dcd58b12f2617 100644 (file)
--- a/gen/ca.dc
+++ b/gen/ca.dc
@@ -46,10 +46,10 @@ char **argv;
     initialize_sms_error_table ();
 
 #ifsql INGRES
-    EXEC SQL CONNECT sms;
+    EXEC SQL CONNECT moira;
 #endsql
 #ifsql INFORMIX
-    EXEC SQL DATABASE sms;
+    EXEC SQL DATABASE moira;
 #endsql
 
     if (argc == 2) {
@@ -75,6 +75,9 @@ char **argv;
        outf = NULL;
     }
 
+    /* The following WHENEVER is declarative, not executed,
+     * and applies for the remainder of this file only.
+     */
     EXEC SQL WHENEVER SQLERROR GOTO sqlerr;
     sq = sq_create();
 
@@ -126,7 +129,7 @@ char **argv;
     EXEC SQL DECLARE z CURSOR FOR 
       SELECT DISTINCT u.login, u.fullname, f.name
       FROM users u, filesys f
-       WHERE f.label = u.login and u.status = 1 and f.type = "AFS"
+       WHERE f.label = u.login and u.status = 1 and f.type = 'AFS'
        ORDER BY name;
     EXEC SQL OPEN z;
     while (1) {
index adb9044c54ab7903351aefd62b66e61ce2b0a288..8ff2575747a93c24ffb9266fb05c84e3ed641262 100644 (file)
@@ -40,10 +40,10 @@ char **argv;
     EXEC SQL END DECLARE SECTION;
 
 #ifsql INGRES
-    EXEC SQL CONNECT sms;
+    EXEC SQL CONNECT moira;
 #endsql
 #ifsql INFORMIX
-    EXEC SQL DATABASE sms;
+    EXEC SQL DATABASE moira;
 #endsql
 
     if (argc == 2) {
index 9d3c97192448692df77dbee3fd728b6d9ff49f84..42a4dbe954330094dd9b0260341251c47022c459 100644 (file)
@@ -1,4 +1,3 @@
-
 /* $Header$
  *
  * This generates the /usr/lib/aliases file for the mailhub.
@@ -47,10 +46,10 @@ char **argv;
     EXEC SQL END DECLARE SECTION;
 
 #ifsql INGRES
-    EXEC SQL CONNECT sms;
+    EXEC SQL CONNECT moira;
 #endsql
 #ifsql INFORMIX
-    EXEC SQL DATABASE sms;
+    EXEC SQL DATABASE moira;
 #endsql
 
     if (argc == 2) {
@@ -145,6 +144,10 @@ get_info()
     struct list *l, *memberlist;
     register struct member *m;
 
+    /* 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 SELECT modtime INTO :buf FROM users WHERE users_id = 0;
index 666264e0b80f67e6bcec17fcaec5397544d790a2..6db511d7dc3f1beb9ffa7c89d6eb46f6eeb81dea 100644 (file)
@@ -40,10 +40,10 @@ char **argv;
     initialize_sms_error_table();
 
 #ifsql INGRES
-    EXEC SQL CONNECT sms;
+    EXEC SQL CONNECT moira;
 #endsql
 #ifsql INFORMIX
-    EXEC SQL DATABASE sms;
+    EXEC SQL DATABASE moira;
 #endsql
 
     if (argc == 2) {
@@ -100,6 +100,10 @@ FILE *out;
     char affil[5];
     EXEC SQL END DECLARE SECTION;
 
+    /* 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;
 
     /* get locks */
@@ -119,7 +123,7 @@ FILE *out;
 
     EXEC SQL DECLARE u_cursor1 CURSOR FOR
       SELECT users_id, login, first, middle, last,
-            mit_year, mit_dept, office_addr, office_phone,
+            affiliation, department, office_addr, office_phone,
             home_addr, home_phone, potype, box_id
       FROM users
       WHERE status != 3;
index d8b68a8eb0bdf8f25d7373b0c859b13972f1cca1..fb2c915b3a5beb5d673f984489e017a5abdb47b4 100644 (file)
@@ -40,10 +40,10 @@ char **argv;
     sprintf(nfs_dir, "%s/nfs", DCM_DIR);
 
 #ifsql INGRES
-    EXEC SQL CONNECT sms;
+    EXEC SQL CONNECT moira;
 #endsql
 #ifsql INFORMIX
-    EXEC SQL DATABASE sms;
+    EXEC SQL DATABASE moira;
 #endsql
 
     changed = do_nfs();
@@ -85,6 +85,10 @@ int do_nfs()
     machs = sq_create();
     lists = sq_create();
 
+    /* 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 s_cursor CURSOR FOR
       SELECT m.name, s.value3
@@ -231,7 +235,7 @@ struct hash *do_everyone()
     EXEC SQL DECLARE l_cursor CURSOR FOR
      SELECT gid, list_id
      FROM list
-     WHERE grp <> 0 AND active != 0;
+     WHERE grouplist != 0 AND active != 0;
     EXEC SQL OPEN l_cursor;
     while (1) {
         EXEC SQL FETCH l_cursor INTO :gid, :lid;
index 658163ab0eca67f8876484d372df06ecedbc2c3a..ea66e64056182149db66a43e13617764e81bcd67 100644 (file)
@@ -35,10 +35,10 @@ char **argv;
     EXEC SQL END DECLARE SECTION;
 
 #ifsql INGRES
-    EXEC SQL CONNECT sms;
+    EXEC SQL CONNECT moira;
 #endsql
 #ifsql INFORMIX
-    EXEC SQL DATABASE sms;
+    EXEC SQL DATABASE moira;
 #endsql
 
     if (argc == 2) {
@@ -64,6 +64,10 @@ char **argv;
        outf = NULL;
     }
 
+    /* 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 
index 0c1d32968d00362412b30266faa83baafd513144..d35beb022e01822445e4cb3d94c4bfac97679ce0 100644 (file)
@@ -33,10 +33,10 @@ char **argv;
     EXEC SQL END DECLARE SECTION;
 
 #ifsql INGRES
-    EXEC SQL CONNECT sms;
+    EXEC SQL CONNECT moira;
 #endsql
 #ifsql INFORMIX
-    EXEC SQL DATABASE sms;
+    EXEC SQL DATABASE moira;
 #endsql
 
     if (argc == 2) {
@@ -62,11 +62,15 @@ char **argv;
        outf = NULL;
     }
 
+    /* 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 
-      mit_id, login
-       FROM users WHERE status != 3 and potype="POP";
+      clearid, login
+       FROM users WHERE status != 3 and potype='POP';
     EXEC SQL OPEN x;
     while (1) {
        EXEC SQL FETCH x INTO :id, :login;
@@ -80,9 +84,9 @@ char **argv;
     EXEC SQL CLOSE x;
 
     EXEC SQL DECLARE y CURSOR FOR SELECT 
-      u.mit_id, s.string
+      u.clearid, s.string
        FROM users u, strings s
-       WHERE u.status != 3 and u.potype="SMTP" and u.box_id = s.string_id;
+       WHERE u.status != 3 and u.potype='SMTP' and u.box_id = s.string_id;
     EXEC SQL OPEN y;
     while (1) {
        EXEC SQL FETCH y INTO :id, :string;
index 354c72999fcd902175553937d245524b4a553f29..6d8012c6ac0ebb29932a40ce6434537e6f7cd29c 100644 (file)
@@ -33,10 +33,10 @@ char **argv;
     EXEC SQL END DECLARE SECTION;
 
 #ifsql INGRES
-    EXEC SQL CONNECT sms;
+    EXEC SQL CONNECT moira;
 #endsql
 #ifsql INFORMIX
-    EXEC SQL DATABASE sms;
+    EXEC SQL DATABASE moira;
 #endsql
 
     if (argc == 2) {
@@ -62,10 +62,14 @@ char **argv;
        outf = NULL;
     }
 
+    /* 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, mit_year FROM users WHERE status = 1;
+      SELECT login, affiliation FROM users WHERE status = 1;
     EXEC SQL OPEN x;
     while (1) {
        EXEC SQL FETCH x INTO :login, :class;
index 284b2c7fc6a8bf05f9f8a51fa2b6b406bdbbce73..06192c7825e7e08037e922b685667c2036b0416d 100644 (file)
@@ -49,10 +49,10 @@ char **argv;
     initialize_sms_error_table ();
 
 #ifsql INGRES
-    EXEC SQL CONNECT sms;
+    EXEC SQL CONNECT moira;
 #endsql
 #ifsql INFORMIX
-    EXEC SQL DATABASE sms;
+    EXEC SQL DATABASE moira;
 #endsql
 
     if (argc == 2) {
@@ -81,10 +81,14 @@ char **argv;
     gettimeofday(&now, NULL);
     cutoff = now.tv_sec - 14 * 24 * 60 * 60;
 
+    /* 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.mit_id, u.signature, u.sigdate, s.string
+      SELECT u.login, u.clearid, u.signature, u.sigdate, s.string
       FROM users u, strings s
        WHERE u.status = 1 and u.sigwho = s.string_id and u.sigwho != 0
          and u.secure <= :cutoff and u.secure != 0;
index 4e8dd9a58665bc07bbc7ca06748b083d0a13faa5..78d6de9e740b52bf7154ff42913e385fbd3a8f91 100644 (file)
@@ -37,10 +37,10 @@ char **argv;
     EXEC SQL END DECLARE SECTION;
 
 #ifsql INGRES
-    EXEC SQL CONNECT sms;
+    EXEC SQL CONNECT moira;
 #endsql
 #ifsql INFORMIX
-    EXEC SQL DATABASE sms;
+    EXEC SQL DATABASE moira;
 #endsql
 
     if (argc == 2) {
@@ -67,6 +67,10 @@ char **argv;
        outf = NULL;
     }
 
+    /* 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;
 
     machines = create_hash(1000);
@@ -85,7 +89,7 @@ char **argv;
     EXEC SQL DECLARE x CURSOR FOR
       SELECT DISTINCT f.mach_id, count(f.filsys_id)
       FROM filesys f
-       WHERE f.type="NFS"
+       WHERE f.type='NFS'
       GROUP BY f.mach_id;
     EXEC SQL OPEN x;
     while (1) {
index fc4a2f68ab38a83ebe0c5290fd9c9027855fff06..9bb1fe8f061834b8c22596c8c462d16d022314b2 100644 (file)
@@ -38,10 +38,10 @@ char **argv;
     sprintf(zephyr_dir, "%s/zephyr", DCM_DIR);
 
 #ifsql INGRES
-EXEC SQL CONNECT sms;
+EXEC SQL CONNECT moira;
 #endsql
 #ifsql INFORMIX
-EXEC SQL DATABASE sms;
+EXEC SQL DATABASE moira;
 #endsql
 
     changed = do_classes();
@@ -116,6 +116,10 @@ int do_classes()
     top = (struct zclass *)malloc(sizeof(struct zclass));
     next = top;
 
+    /* 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 classes CURSOR FOR SELECT class, xmt_type, xmt_id,
        sub_type, sub_id, iws_type, iws_id, iui_type, iui_id
@@ -218,7 +222,7 @@ char *atype;
 
     EXEC SQL DECLARE umember CURSOR FOR SELECT users.login
       FROM users, imembers
-      WHERE imembers.list_id = :zid and imembers.member_type="USER" and
+      WHERE imembers.list_id = :zid and imembers.member_type='USER' and
        imembers.member_id=users.users_id;
     EXEC SQL OPEN umember;
     while (1) {
@@ -235,7 +239,7 @@ char *atype;
     EXEC SQL DECLARE smember CURSOR FOR SELECT strings.string
       FROM strings, imembers
       WHERE imembers.list_id = :zid and imembers.member_id=strings.string_id
-       and (imembers.member_type="STRING" or imembers.member_type="KERBEROS");
+       and (imembers.member_type='STRING' or imembers.member_type='KERBEROS');
     EXEC SQL OPEN smember;
     while (1) {
        EXEC SQL FETCH smember INTO :str;
This page took 0.073311 seconds and 5 git commands to generate.