EXEC SQL INCLUDE sqlca; /* SQL Communications Area */
EXEC SQL INCLUDE sqlda; /* SQL Descriptor Area */
-#define SQLDA_RETVALS
-typedef IISQLDA_TYPE(DBCK_SQLDA,DBCK_SQLDA_T,SQLDA_RETVALS);
-DBCK_SQLDA_T SQLDA;
-
static char fix_qc_rcsid[] = "$Header$";
EXEC SQL BEGIN DECLARE SECTION;
char stmt_buf[500];
EXEC SQL END DECLARE SECTION;
+extern SQLDA *mr_sqlda;
+
generic_ffunc(id)
EXEC SQL BEGIN DECLARE SECTION;
int id;
int rowcount;
EXEC SQL END DECLARE SECTION;
-/* delete _table where _table._idfield = id */
sprintf(stmt_buf,"DELETE FROM %s WHERE %s.%s = %d",
_table,_table,_idfield,id);
EXEC SQL EXECUTE IMMEDIATE :stmt_buf;
-/* inquire_equel(rowcount = "rowcount") */
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
else
int rowcount;
EXEC SQL END DECLARE SECTION;
-/* replace tbl (zrfield = 0) where table.idfield = id */
sprintf(stmt_buf,"UPDATE %s SET %s = 0 WHERE %s.%s = %d",
tbl,zrfield,tbl,idfield,id);
EXEC SQL EXECUTE IMMEDIATE :stmt_buf;
-/* inquire_equel(rowcount = "rowcount") */
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
else
if (buf[0] == 'Q' || buf[0] == 'q') {
if (prompt("Are you sure you want to quit")) {
if (prompt("Save database changes")) {
-/* end transaction */
EXEC SQL COMMIT WORK;
cleanup();
exit(0);
} else {
-/* abort */
EXEC SQL ROLLBACK WORK;
-/* replace values (value = dcmenable)
- * where values.name = "dcm_enable" */
EXEC SQL UPDATE numvalues SET value = :dcmenable
WHERE name='dcm_enable';
-/* exit */
- /* No equivalent (?) */
exit(1);
}
}
**/
int set_next_object_id(object, tablename)
+EXEC SQL BEGIN DECLARE SECTION;
char *object;
+EXEC SQL END DECLARE SECTION;
char *tablename;
{
EXEC SQL BEGIN DECLARE SECTION;
- char *name, *tbl;
- int rowcount, existence, value;
+ int value;
+ char stmt_buf[256], out_buf[256];
EXEC SQL END DECLARE SECTION;
+ int starting_value, errcode=0;
- name = object;
- tbl = tablename;
-/* range of v is values
- * repeat retrieve (value = v.#value) where v.#name = @name */
- EXEC SQL REPEATED SELECT value INTO :value FROM numvalues
- WHERE name = :name;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
- if (rowcount != 1)
+ EXEC SQL SELECT value INTO :value FROM numvalues WHERE name = :object;
+ if (sqlca.sqlerrd[2] != 1)
return(MR_NO_ID);
-/* retrieve (existence = any(tbl.name where tbl.name = value)) */
- SQLDA.sqlvar[0].sqldata=(void *)&rowcount;
- sprintf(stmt_buf,"SELECT COUNT (*) FROM %s WHERE %s=%d",tbl,name,value);
- EXEC SQL PREPARE stmt INTO :&SQLDA USING NAMES FROM :stmt_buf;
- if(sqlca.sqlcode)
- return(MR_INTERNAL);
- EXEC SQL DECLARE foo CURSOR FOR stmt;
- EXEC SQL OPEN foo;
- EXEC SQL FETCH foo USING DESCRIPTOR :&SQLDA;
- if (sqlca.sqlcode < 0) return(MR_INTERNAL);
- if (sqlca.sqlcode == 100) existence=0; else existence=1;
- EXEC SQL CLOSE foo;
-
- if (rowcount != 1)
- return(MR_NO_ID);
- while (existence) {
+ starting_value=value;
+ while(1) {
+ if (value > MAX_ID_VALUE) value = MIN_ID_VALUE;
+
+ sprintf(stmt_buf, "SELECT %s FROM %s WHERE %s=%d",
+ object, tablename, object, value);
+ EXEC SQL PREPARE inc_stmt FROM :stmt_buf;
+ EXEC SQL DECLARE inc_crs CURSOR FOR inc_stmt;
+ EXEC SQL OPEN inc_crs;
+ mr_sqlda->N = 1;
+ EXEC SQL DESCRIBE SELECT LIST FOR inc_stmt INTO mr_sqlda;
+ mr_sqlda->N = mr_sqlda->F;
+ mr_sqlda->V[0]=out_buf;
+ mr_sqlda->T[0]=97;
+ mr_sqlda->L[0]=255;
+ EXEC SQL FETCH inc_crs USING DESCRIPTOR mr_sqlda;
+
+ /* if we got an error from the FETCH, we have to preserve it or the
+ close will reset it and the caller with think nothing happened */
+ if(sqlca.sqlcode) errcode=sqlca.sqlcode;
+
+ EXEC SQL CLOSE inc_crs;
+ if (errcode < 0) return(MR_DBMS_ERR);
+ if (errcode == 1403) break;
+
value++;
- if (value > MAX_ID_VALUE)
- value = MIN_ID_VALUE;
-/* retrieve (existence = any(tbl.name where tbl.name = value)) */
- sprintf(stmt_buf,"SELECT %s FROM %s WHERE %s=%d",name,tbl,name,value);
- EXEC SQL PREPARE stmt INTO :&SQLDA USING NAMES FROM :stmt_buf;
- if(sqlca.sqlcode)
- return(MR_INTERNAL);
- EXEC SQL DECLARE bar CURSOR FOR stmt;
- EXEC SQL OPEN bar;
- EXEC SQL FETCH bar USING DESCRIPTOR :&SQLDA;
- if (sqlca.sqlcode != 0) break;
- EXEC SQL CLOSE bar;
+ if (value == starting_value) return (MR_NO_ID);
}
- EXEC SQL CLOSE bar;
- printf("setting ID %s to %d\n", name, value);
-/* repeat replace v (#value = @value) where v.#name = @name */
- EXEC SQL REPEATED UPDATE numvalues SET value = :value
- WHERE name = :name;
+ printf("setting ID %s to %d\n", object, value);
+ EXEC SQL UPDATE numvalues SET value = :value WHERE name = :object;
modified("values");
return(MR_SUCCESS);
}
EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
- int rowcount, id, temp;
+ int rowcount, id;
EXEC SQL END DECLARE SECTION;
set_next_object_id(tbl, idfield);
-/* retrieve (id = values.value) where values.#name = idfield */
EXEC SQL SELECT value INTO :id FROM numvalues
WHERE name = :idfield;
-/* replace tbl (idfield = values.value) where values.#name = idfield and
- * tbl.idfield = oldid and tbl.txtfield = name
- */
- EXEC SQL SELECT value INTO :temp FROM numvalues
- WHERE name = :idfield;
sprintf(stmt_buf,"UPDATE %s SET %s = %d WHERE %s=%d AND %s='%s'",
- tbl,idfield,temp,idfield,oldid,txtfield,name);
+ tbl,idfield,id,idfield,oldid,txtfield,name);
EXEC SQL EXECUTE IMMEDIATE :stmt_buf;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount == 1)
printf("Fixed\n");
else
modified(tbl);
return(id);
}
-
-de_dup( tbl, idfield, id, dupfield, correct_val )
-EXEC SQL BEGIN DECLARE SECTION;
-char *tbl, *idfield, *dupfield;
-int id, correct_val;
-EXEC SQL END DECLARE SECTION;
-{
- int size, i;
- EXEC SQL BEGIN DECLARE SECTION;
- int rowcount;
- EXEC SQL END DECLARE SECTION;
-
-/* replace tbl.dupfield with correct_val where tbl.idfield = id */
- sprintf( stmt_buf,"UPDATE %s SET %d = %d WHERE %s = %d",
- tbl, dupfield, correct_val, idfield, id );
- size = strlen( stmt_buf );
- for( i=0; i!=NULL && i<500; i++ ) { ; } /* Move to an unused string. */
-
-}
#include "dbck.h"
EXEC SQL INCLUDE sqlca;
-
static char phase1_qc_rcsid[] = "$Header$";
+EXEC SQL WHENEVER SQLERROR DO dbmserr();
show_user_id(u)
struct user *u;
int id = uu->users_id, rowcount;
EXEC SQL END DECLARE SECTION;
- EXEC SQL UPDATE users SET login = '#'+CHAR(users.uid),
+ EXEC SQL UPDATE users SET login = '#' || CHAR(users.unix_uid),
status=0 WHERE users_id = :id;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
else
SELECT s1.string_id, s2.string_id FROM strings s1, strings s2
where s1.string = s2.string and s1.string_id < s2.string_id;
EXEC SQL OPEN csr116;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
/* The SELECT gives us two columns, both with non-negative integers.
* The number in the left column is always the smaller of the two,
* and each row includes string IDs for identical strings. We use
q=0;
while(1) {
EXEC SQL FETCH csr116 INTO :id1, :id2;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
q++;
/* If id2 is already stored, skip this row. */
i = int_hash_lookup( string_dups, id2 );
if(!sq || !strings) out_of_mem("loading strings");
EXEC SQL DECLARE csr101 CURSOR FOR
- SELECT string_id, string, tid FROM strings ORDER BY string_id;
+ SELECT string_id, string FROM strings ORDER BY string_id;
EXEC SQL OPEN csr101;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
q=0;
while(1) {
- EXEC SQL FETCH csr101 INTO :id, :buf, :id1;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ EXEC SQL FETCH csr101 INTO :id, :buf;
+ if (sqlca.sqlcode != 0) break;
q++;
s = (struct string *) malloc(sizeof(struct string));
if (s == NULL)
EXEC SQL DECLARE csr102 CURSOR FOR
SELECT users_id, login, last, first, status, potype, pop_id, box_id,
- modby, fmodby, pmodby, comment, sigwho FROM users
+ modby, fmodby, pmodby, comments, sigwho FROM users
ORDER BY users_id;
EXEC SQL OPEN csr102;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr102 INTO :id, :name, :last, :first, :status,
:buf, :id2, :id3, :sid, :sid2, :sid3, :sid4, :sid5;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
u = (struct user *) malloc(sizeof(struct user));
if (u == NULL)
EXEC SQL DECLARE csr103 CURSOR FOR
SELECT u1.users_id FROM users u1, users u2
- WHERE u1.login = u2.login and u1.tid != u2.tid;
+ WHERE u1.login = u2.login and u1.rowid != u2.rowid;
EXEC SQL OPEN csr103;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr103 INTO :id;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
sq_save_data(sq, hash_lookup(users, id));
}
EXEC SQL CLOSE csr103;
EXEC SQL DECLARE csr113 CURSOR FOR
SELECT k1.users_id FROM krbmap k1, krbmap k2
- WHERE k1.users_id = k2.users_id AND k1.tid != k2.tid;
+ WHERE k1.users_id = k2.users_id AND k1.rowid != k2.rowid;
EXEC SQL OPEN csr113;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr113 INTO :id;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
printf("User %d is in the krbmap more than once!\n", id);
printf("Not fixing this error\n");
EXEC SQL DECLARE csr114 CURSOR FOR
SELECT k1.string_id FROM krbmap k1, krbmap k2
- WHERE k1.string_id = k2.string_id AND k1.tid != k2.tid;
+ WHERE k1.string_id = k2.string_id AND k1.rowid != k2.rowid;
EXEC SQL OPEN csr114;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr114 INTO :id;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
printf("Principal %d is in the krbmap more than once!\n", id);
printf("Not fixing this error\n");
acomment, ocomment, creator, modby
FROM machine ORDER BY mach_id;
EXEC SQL OPEN csr104;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr104 INTO :id, :name, :id2, :buf, :id3, :sid2,
:sid3, :sid4, :sid;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
m = (struct machine *) malloc(sizeof(struct machine));
if (m == NULL)
EXEC SQL DECLARE csr105 CURSOR FOR
SELECT m1.mach_id FROM machine m1, machine m2
- WHERE m1.name = m2.name AND m1.tid != m2.tid;
+ WHERE m1.name = m2.name AND m1.rowid != m2.rowid;
EXEC SQL OPEN csr105;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr105 INTO :id;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
sq_save_data(sq, hash_lookup(machines, id));
}
WHERE h1.name=h2.name AND h1.mach_id!=h2.mach_id
AND m1.mach_id=h1.mach_id AND m2.mach_id=h2.mach_id;
EXEC SQL OPEN csr_hal1;
- if(sqlca.sqlcode!=0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr_hal1 INTO :name, :id1, :id2;
- if(sqlca.sqlcode!=0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if(sqlca.sqlcode!=0) break;
printf("Aliases for machines %d and %d have duplicate name %s\n",
id1, id2, strtrim(name));
cant_fix();
FROM hostalias h1, machine m1, machine m2
WHERE h1.name=m1.name AND h1.mach_id=m2.mach_id;
EXEC SQL OPEN csr_hal2;
- if(sqlca.sqlcode!=0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr_hal2 INTO :name, :id1, :id2;
- if(sqlca.sqlcode!=0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if(sqlca.sqlcode!=0) break;
printf("Machine %d has alias `%s' that conflicts with machine %d\n",
id2, strtrim(name), id1);
cant_fix();
EXEC SQL DECLARE csr115 CURSOR FOR
SELECT snet_id, name, owner_type, owner_id, modby from subnet;
EXEC SQL OPEN csr115;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr115 INTO :id, :name, :buf, :id2, :sid;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
sn = (struct subnet *) malloc(sizeof(struct machine));
if (sn == NULL)
if(!sq || !clusters) out_of_mem("loading clusters");
EXEC SQL DECLARE csr106 CURSOR FOR
- SELECT clu_id, name, modby FROM cluster;
+ SELECT clu_id, name, modby FROM clusters;
EXEC SQL OPEN csr106;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr106 INTO :id, :name, :sid;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
c = (struct cluster *) malloc(sizeof(struct cluster));
if (c == NULL)
if(!sq) out_of_mem("looking for duplicate cluster names");
EXEC SQL DECLARE csr107 CURSOR FOR
- SELECT c1.clu_id FROM cluster c1, cluster c2
- WHERE c1.name=c2.name AND c1.tid != c2.tid;
+ SELECT c1.clu_id FROM clusters c1, clusters c2
+ WHERE c1.name=c2.name AND c1.rowid != c2.rowid;
EXEC SQL OPEN csr107;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr107 INTO :id;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
sq_save_data(sq, hash_lookup(clusters, id));
}
SELECT list_id, name, acl_id, acl_type, modby FROM list
ORDER BY list_id;
EXEC SQL OPEN csr108;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr108 INTO :id, :name, :aid, :buf, :sid;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
l = (struct list *) malloc(sizeof(struct list));
if (l == NULL)
out_of_mem("storing lists");
EXEC SQL DECLARE csr109 CURSOR FOR
SELECT l1.list_id FROM list l1, list l2
- WHERE l1.name=l2.name AND l1.tid != l2.tid;
+ WHERE l1.name=l2.name AND l1.rowid != l2.rowid;
EXEC SQL OPEN csr109;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr109 INTO :id;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
sq_save_data(sq, hash_lookup(lists, id));
}
SELECT filsys_id, label, owner, owners, phys_id, mach_id,
type, name, modby FROM filesys ORDER BY filsys_id;
EXEC SQL OPEN csr110;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr110 INTO :id, :name, :aid, :aid2, :id2, :id3,
:buf, :name1, :sid;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
f = (struct filesys *) malloc(sizeof(struct filesys));
if (f == NULL)
EXEC SQL DECLARE csr111 CURSOR FOR
SELECT nfsphys_id, dir, mach_id, allocated, modby FROM nfsphys;
EXEC SQL OPEN csr111;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr111 INTO :id, :name, :id2, :id3, :sid;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
n = (struct nfsphys *) malloc(sizeof(struct nfsphys));
if (n == NULL)
static char phase2_qc_rcsid[] = "$Header$";
+EXEC SQL WHENEVER SQLERROR DO dbmserr();
show_mcm_mach(id)
int id;
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr201 CURSOR FOR
- SELECT cluster.name FROM cluster, mcmap
- WHERE cluster.clu_id=mcmap.clu_id AND mcmap.mach_id = :iid;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
+ SELECT clusters.name FROM clusters, mcmap
+ WHERE clusters.clu_id=mcmap.clu_id AND mcmap.mach_id = :iid;
EXEC SQL OPEN csr201;
while(1) {
EXEC SQL FETCH csr201 INTO :name;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
strtrim(name);
found = 0;
char name[33];
EXEC SQL END DECLARE SECTION;
- EXEC SQL DECLARE csr202 CURSOR
-
-
- FOR
- SELECT machine.name FROM machine, mcmap
- WHERE machine.mach_id=mcmap.mach_id AND mcmap.clu_id=:iid;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
+ EXEC SQL DECLARE csr202 CURSOR FOR
+ SELECT machine.name FROM machine, mcmap
+ WHERE machine.mach_id=mcmap.mach_id AND mcmap.clu_id=:iid;
EXEC SQL OPEN csr202;
while(1) {
EXEC SQL FETCH csr202 INTO :name;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
strtrim(name);
EXEC SQL DECLARE csr234 CURSOR FOR
SELECT name FROM hostalias WHERE mach_id=:iid;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr234;
while(1) {
EXEC SQL FETCH csr234 INTO :name;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
strtrim(name);
EXEC SQL DECLARE csr235 CURSOR FOR
SELECT name FROM printcap WHERE mach_id=:iid;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr235;
while(1) {
EXEC SQL FETCH csr235 INTO :name;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
strtrim(name);
EXEC SQL DECLARE csr236 CURSOR FOR
SELECT name FROM printcap WHERE quotaserver=:iid;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr236;
while(1) {
EXEC SQL FETCH csr236 INTO :name;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
strtrim(name);
int hint;
{
u->comment=maybe_fixup_unref_string(u->comment, id, u->login, "users",
- "comment", "users_id");
+ "comments", "users_id");
u->modby=maybe_fixup_modby(u->modby, id, u->login, "users",
"modby", "users_id");
sprintf(stmt_buf, "UPDATE %s SET %s = %d WHERE %s = %d",
table, field, (sid<0)?-ret:ret, idfield, oid);
EXEC SQL EXECUTE IMMEDIATE :stmt_buf;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount == 1)
printf("Fixed\n");
else
sprintf(stmt_buf, "UPDATE %s SET %s = %d WHERE %s=%d",
table, field, 0, idfield, oid);
EXEC SQL EXECUTE IMMEDIATE :stmt_buf;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount == 1)
printf("Fixed\n");
else
sprintf(stmt_buf, "UPDATE %s SET %s = %d WHERE CURRENT OF %s",
table, field, (sid<0)?-ret:ret, cursor);
EXEC SQL EXECUTE IMMEDIATE :stmt_buf;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount == 1)
printf("Fixed\n");
else
sprintf(stmt_buf, "UPDATE %s SET %s = %d WHERE CURRENT OF %s",
table, field, 0, cursor);
EXEC SQL EXECUTE IMMEDIATE :stmt_buf;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount == 1)
printf("Fixed\n");
else
EXEC SQL END DECLARE SECTION;
EXEC SQL UPDATE users SET potype='NONE' WHERE users.users_id = :iid;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s removed\n", rowcount, rowcount==1?"y":"ies");
else
EXEC SQL END DECLARE SECTION;
EXEC SQL UPDATE users SET box_id=:isid WHERE users.users_id = :iid;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s updated\n", rowcount, rowcount==1?"y":"ies");
else
EXEC SQL END DECLARE SECTION;
EXEC SQL UPDATE machine SET snet_id=0 WHERE mach_id = :iid;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
else
EXEC SQL UPDATE subnet SET owner_type='NONE', owner_id=0
WHERE snet_id = :id;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
else
EXEC SQL UPDATE machine SET owner_type='NONE', owner_id=0
WHERE mach_id = :id;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
else
struct cluster *c;
int hint;
{
- c->modby=maybe_fixup_modby(c->modby, id, c->name, "cluster",
+ c->modby=maybe_fixup_modby(c->modby, id, c->name, "clusters",
"modby", "clu_id");
}
EXEC SQL DECLARE csr203 CURSOR FOR
SELECT serv_label, serv_cluster FROM svc
WHERE clu_id = :iid;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr203;
while(1) {
EXEC SQL FETCH csr203 INTO :label, :data;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
strtrim(label);
strtrim(data);
EXEC SQL UPDATE list SET acl_id = :iid, acl_type='LIST'
WHERE list_id = :iid;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
else
EXEC SQL DECLARE csr204 CURSOR FOR
SELECT member_type, member_id FROM imembers
WHERE list_id = :iid AND direct=1;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr204;
while(1) {
EXEC SQL FETCH csr204 INTO :mtype, :mid;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
strtrim(mtype);
found = 0;
EXEC SQL DECLARE csr205 CURSOR FOR
SELECT list_id FROM imembers
WHERE member_id = :iid AND member_type='USER' AND direct=1;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr205;
while(1) {
EXEC SQL FETCH csr205 INTO :lid;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
found = 0;
printf("List %s has non-existant user member, id %d\n",
EXEC SQL DECLARE csr206 CURSOR FOR
SELECT list_id FROM imembers
WHERE member_id = :iid AND member_type='LIST' AND direct=1;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr206;
while(1) {
EXEC SQL FETCH csr206 INTO :lid;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
found = 0;
printf("List %s has non-existant list member, id %d\n",
EXEC SQL DECLARE csr207 CURSOR FOR
SELECT list_id FROM imembers
WHERE member_id = :iid AND member_type='STRING' AND direct=1;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr207;
while(1) {
EXEC SQL FETCH csr207 INTO :lid;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
found = 0;
printf("List %s has non-existant string member, id %d\n",
EXEC SQL DECLARE csr208 CURSOR FOR
SELECT list_id FROM imembers
WHERE member_id = :iid AND member_type='KERBEROS' AND direct=1;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr208;
while(1) {
EXEC SQL FETCH csr208 INTO :lid;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
found = 0;
printf("List %s has non-existant kerberos member, id %d\n",
EXEC SQL DELETE FROM imembers WHERE member_type='USER' AND
member_id = :id AND direct = 1;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
else
EXEC SQL DELETE FROM imembers WHERE member_type='LIST' AND
member_id = :id AND direct=1;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
else
EXEC SQL DELETE FROM imembers WHERE member_type='STRING' AND
member_id = :id AND direct=1;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
else
EXEC SQL DELETE FROM imembers WHERE member_type='KERBEROS' AND
member_id = :id AND direct=1;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
else
EXEC SQL DECLARE csr209 CURSOR FOR
SELECT service FROM serverhosts
WHERE mach_id = :id;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr209;
while(1) {
EXEC SQL FETCH csr209 INTO :name;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
found = 0;
printf("ServerHost entry for service %s non-existant host %d\n",
EXEC SQL END DECLARE SECTION;
EXEC SQL DELETE FROM serverhosts WHERE mach_id = :id;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
else
printf("Filesys %s with bad machine %d\n", f->name, f->mach_id);
if (single_fix("Fix", 0)) {
EXEC SQL UPDATE filesys SET mach_id = 0 WHERE filsys_id = :id;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n",rowcount, rowcount==1?"y":"ies");
else
id2 = f->filsys_id;
id3 = f->mach_id;
EXEC SQL UPDATE filesys SET phys_id = :id1 WHERE filsys_id = :id2;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n",rowcount, rowcount==1?"y":"ies");
else
}
EXEC SQL INSERT INTO mfsphys (mfsphys_id, mach_id,
device, dir, status, allocated, size, modtime,
- modby, modwith) VALUES (:id1, :id3, '???', :dir,
- 0, 0, 0, 'now', 0, 'dbck');
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ modby, modwith) VALUES (:id1, :id3, '\?\?\?', :dir,
+ 0, 0, 0, SYSDATE, 0, 'dbck');
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s created\n", rowcount,
rowcount==1?"y":"ies");
}
EXEC SQL UPDATE filesys SET phys_id = :id1
WHERE filsys_id = :id2;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d filesys entr%s fixed\n", rowcount,
rowcount==1?"y":"ies");
EXEC SQL DECLARE csr210 CURSOR FOR
SELECT filsys_id FROM fsgroup
WHERE group_id = :id;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr210;
while(1) {
EXEC SQL FETCH csr210 INTO :id1;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
found = 0;
if (f = (struct filesys *) hash_lookup(filesys, id1))
t = "MUL";
break;
default:
- t = "???";
+ t = "\?\?\?";
}
printf("FSGroup %s has type %s instead of FSGROUP\n", f->name, t);
return(0);
EXEC SQL END DECLARE SECTION;
EXEC SQL UPDATE filesys SET type='FSGROUP' WHERE filsys_id = :id;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
else
EXEC SQL DECLARE csr211 CURSOR FOR
SELECT group_id FROM fsgroup
WHERE filsys_id = :id;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr211;
while(1) {
EXEC SQL FETCH csr211 INTO :id1;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
found = 0;
if (f = (struct filesys *) hash_lookup(filesys, id1))
EXEC SQL DECLARE csr212 CURSOR FOR
SELECT filsys_id FROM quota
WHERE entity_id = :id AND type='USER';
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr212;
while(1) {
EXEC SQL FETCH csr212 INTO :id1;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
found = 0;
printf("Quota on fs %d for non-existant user %d\n", id1, id);
EXEC SQL DECLARE csr213 CURSOR FOR
SELECT filsys_id FROM quota
WHERE entity_id = :id AND type='GROUP';
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr213;
while(1) {
EXEC SQL FETCH csr213 INTO :id1;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
found = 0;
printf("Quota on fs %d for non-existant list %d\n", id1, id);
id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
EXEC SQL DELETE FROM quota
WHERE entity_id = :id AND type = 'USER';
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n",rowcount, rowcount==1?"y":"ies");
else
id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
EXEC SQL DELETE FROM quota WHERE entity_id = :id AND type='GROUP';
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n",rowcount, rowcount==1?"y":"ies");
else
EXEC SQL DECLARE csr214 CURSOR FOR
SELECT entity_id, type FROM quota
WHERE filsys_id = :id;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr214;
while(1) {
EXEC SQL FETCH csr214 INTO :id1, :type;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
found = 0;
printf("Quota for %s %d on non-existant filesys %d\n", type, id1, id);
EXEC SQL DECLARE csr215 CURSOR FOR
SELECT entity_id, type FROM quota
WHERE filsys_id = :id;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr215;
while(1) {
EXEC SQL FETCH csr215 INTO :id1, :type;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
found = 0;
printf("Quota for %s %d on filesys %s has wrong phys_id %d\n",
id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
EXEC SQL UPDATE quota SET phys_id = :id1
WHERE filsys_id = :id AND phys_id != :id1;
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n",rowcount, rowcount==1?"y":"ies");
else
EXEC SQL DECLARE csr216 CURSOR FOR
SELECT name FROM servers
WHERE acl_type='USER' and acl_id = :id;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr216;
while(1) {
EXEC SQL FETCH csr216 INTO :name;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
strtrim(name);
printf("Service %s has acl non-existant user %d\n", name, id);
EXEC SQL DECLARE csr217 CURSOR FOR
SELECT name FROM servers
WHERE acl_type='LIST' AND acl_id = :id;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr217;
while(1) {
EXEC SQL FETCH csr217 INTO :name;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
strtrim(name);
printf("Service %s has acl non-existant list %d\n", name, id);
EXEC SQL UPDATE servers SET acl_id=0 WHERE acl_id = :id AND
acl_type='USER';
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
else
EXEC SQL UPDATE servers SET acl_id=0 WHERE acl_id = :id AND
acl_type='LIST';
- EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
+ rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
else
EXEC SQL DECLARE csr218 CURSOR FOR
SELECT string_id FROM krbmap
WHERE users_id = :id ;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr218;
while(1) {
EXEC SQL FETCH csr218 INTO :id1;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
if (s = ((struct string *)hash_lookup(strings, id1)))
ss = s->name;
EXEC SQL DECLARE csr219 CURSOR FOR
SELECT users_id FROM krbmap
WHERE string_id = :id;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr219;
while(1) {
EXEC SQL FETCH csr219 INTO :id1;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
if (u = ((struct user *)hash_lookup(users, id1)))
s = u->login;
else
- s = "[???]";
+ s = "[\?\?\?]";
found = 0;
printf("Kerberos map for user %s (%d) to non-existant string %d\n",
s, id1, id);
EXEC SQL DECLARE csr220 CURSOR FOR
SELECT name FROM palladium
WHERE mach_id = :id;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr220;
while(1) {
EXEC SQL FETCH csr220 INTO :name;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
strtrim(name);
printf("Palladium server/supervisor %s is on non-existant machine %d\n",
sq2 = sq_create();
EXEC SQL DECLARE csr221 CURSOR FOR
SELECT mach_id, clu_id FROM mcmap;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr221;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
while(1) {
EXEC SQL FETCH csr221 INTO :id1, :id2;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
if (!(m = (struct machine *)hash_lookup(machines, id1)))
sq_save_unique_data(sq1, id1);
sq1 = sq_create();
EXEC SQL DECLARE csr222 CURSOR FOR
SELECT clu_id FROM svc;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr222;
while(1) {
EXEC SQL FETCH csr222 INTO :id1;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
if (!hash_lookup(clusters, id1))
sq_save_unique_data(sq1, id1);
EXEC SQL DECLARE csr223 CURSOR FOR
SELECT list_id, member_type, member_id, ref_count, direct
- FROM imembers FOR DEFERRED UPDATE OF member_id;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
+ FROM imembers FOR UPDATE OF member_id;
EXEC SQL OPEN csr223;
while(1) {
EXEC SQL FETCH csr223 INTO :id1, :type, :id2, :id3, :id4;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
if ((l = (struct list *) hash_lookup(lists, id1)) == NULL)
sq_save_unique_data(sq1, id1);
sq2 = sq_create();
EXEC SQL DECLARE csr224 CURSOR FOR
SELECT name, acl_type, acl_id, modby FROM servers
- FOR DEFERRED UPDATE of modby;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
+ FOR UPDATE of modby;
EXEC SQL OPEN csr224;
while(1) {
EXEC SQL FETCH csr224 INTO :name, :type, :id1, :id2;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
maybe_fixup_modby2("servers","modby","csr224",id2);
strtrim(type);
sq = sq_create();
EXEC SQL DECLARE csr225 CURSOR FOR
SELECT mach_id, modby FROM serverhosts
- FOR DEFERRED UPDATE OF modby;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
+ FOR UPDATE OF modby;
EXEC SQL OPEN csr225;
while(1) {
EXEC SQL FETCH csr225 INTO :id1, :id2;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
maybe_fixup_modby2("serverhosts", "modby", "csr225", id2);
if (!hash_lookup(machines, id1))
sq3 = sq_create();
EXEC SQL DECLARE csr226 CURSOR FOR
SELECT group_id, filsys_id FROM fsgroup;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr226;
while(1) {
EXEC SQL FETCH csr226 INTO :id1, :id2;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
if (!(f = (struct filesys *) hash_lookup(filesys, id1)))
sq_save_data(sq1, id1);
sq4 = sq_create();
EXEC SQL DECLARE csr227 CURSOR FOR
SELECT entity_id, type, filsys_id, phys_id, quota, modby
- FROM quota FOR DEFERRED UPDATE OF modby;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
+ FROM quota FOR UPDATE OF modby;
EXEC SQL OPEN csr227;
while(1) {
EXEC SQL FETCH csr227 INTO :id1, :type, :id2, :id3, :id4, :id5;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
maybe_fixup_modby2("quota", "modby", "csr227", id5);
if (type[0] == 'U' && id1 != 0 && !hash_lookup(users, id1))
dprintf("Checking hostaccess...\n");
EXEC SQL DECLARE csr228 CURSOR FOR
SELECT mach_id, acl_type, acl_id, modby FROM hostaccess
- FOR DEFERRED UPDATE OF modby;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
+ FOR UPDATE OF modby;
EXEC SQL OPEN csr228;
while(1) {
EXEC SQL FETCH csr228 INTO :id1, :type, :id2, :id3;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
maybe_fixup_modby2("hostaccess", "modby", "csr228", id3);
strtrim(type);
sq1 = sq_create();
EXEC SQL DECLARE csr229 CURSOR FOR
SELECT mach_id, modby FROM palladium
- FOR DEFERRED UPDATE OF modby;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
+ FOR UPDATE OF modby;
EXEC SQL OPEN csr229;
while(1) {
EXEC SQL FETCH csr229 INTO :id1, :id2;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
maybe_fixup_modby2("palladium", "modby", "csr229", id2);
if (!hash_lookup(machines, id1)) {
sq2 = sq_create();
EXEC SQL DECLARE csr230 CURSOR FOR
SELECT users_id, string_id FROM krbmap
- FOR DEFERRED UPDATE OF string_id;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
+ FOR UPDATE OF string_id;
EXEC SQL OPEN csr230;
while(1) {
EXEC SQL FETCH csr230 INTO :id1, :id2;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
if (!hash_lookup(users, id1))
sq_save_unique_data(sq1, id1);
dprintf("Checking capacls...\n");
EXEC SQL DECLARE csr231 CURSOR FOR
SELECT list_id, tag FROM capacls;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr231;
while(1) {
EXEC SQL FETCH csr231 INTO :id1, :name;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
if (!hash_lookup(lists, id1)) {
printf("Capacl for %s is non-existant list %d\n", name, id1);
sq1 = sq_create();
EXEC SQL DECLARE csr232 CURSOR FOR
SELECT mach_id FROM hostalias;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr232;
while(1) {
EXEC SQL FETCH csr232 INTO :id1;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
if (!hash_lookup(machines, id1))
sq_save_unique_data(sq1, id1);
sq2 = sq_create();
EXEC SQL DECLARE csr233 CURSOR FOR
SELECT mach_id, quotaserver, modby FROM printcap;
- if (sqlca.sqlcode != 0) ingerr(&sqlca.sqlcode);
EXEC SQL OPEN csr233;
while(1) {
EXEC SQL FETCH csr233 INTO :id1, :id2, :id3;
- if (sqlca.sqlcode != 0) {
- ingerr(&sqlca.sqlcode);
- break;
- }
+ if (sqlca.sqlcode != 0) break;
maybe_fixup_modby2("printcap", "modby", "csr233", id3);
if (!hash_lookup(machines, id1))