]> andersk Git - moira.git/blobdiff - server/increment.dc
put the name of the database in a variable
[moira.git] / server / increment.dc
index 6b5f0f6ec37b8b864babf3f0ded8de1e5b2c551d..555ed7e8a4ddee1a404a3968583d3d38929640ae 100644 (file)
@@ -233,6 +233,7 @@ char **argv;
 {
     char buffer[2048], *name;
 EXEC SQL BEGIN DECLARE SECTION; 
+    char *type;
     int id, i;
 EXEC SQL END DECLARE SECTION; 
     struct iupdate *iu;
@@ -286,7 +287,12 @@ EXEC SQL END DECLARE SECTION;
        strcpy(aarg0, "?");
        strcpy(aarg1, argv[1]);
        strcpy(aarg2, "?");
-       sprintf(buffer, "%s and fs.filsys_id = q.filsys_id", qual);
+       if (!strcmp(argv[1], "ANY"))
+         type = "NONE";
+       else
+         type = argv[1];
+       sprintf(buffer, "%s and fs.filsys_id = q.filsys_id and q.type = '%s'",
+               qual, type);
        qual = buffer;
        EXEC SQL SELECT CHAR(q.quota), fs.name INTO :aarg3, :aarg4
          FROM quota q, filesys fs WHERE :qual;
This page took 0.029729 seconds and 4 git commands to generate.