int set_modtime(struct query *q, char *argv[], client *cl)
{
char *name, *entity, *table;
- int who;
+ int who, row = 0;
entity = cl->entity;
who = cl->client_id;
table = table_name[q->rtable];
- name = argv[0];
+
+ if (q->type == MR_Q_UPDATE)
+ row = 1;
+
+ name = argv[0 + row];
sprintf(stmt_buf, "UPDATE %s SET modtime = SYSDATE, modby = %d, "
"modwith = '%s' WHERE name = '%s'", table, who, entity, name);
MR_Q_UPDATE,
"pr",
PRINTERS_TABLE,
- "printers SET name = '%s', type = '%s', hwtype = '%s', duplexname = NVL('%s', CHR(0)), mach_id = %d, loghost = %d, rm = %d, rp = NVL('%s', CHR(0)), rq = %d, ka = %d, pc = %d, ac = %d, lpc_acl = %d, banner = %d, location = NVL('%s', CHR(0)), contact = NVL('%s', CHR(0))",
+ "printers SET name = '%s', type = '%s', hwtype = '%s', duplexname = NVL('%s', CHR(0)), mach_id = %d, loghost = %d, rm = %d, rp = NVL('%s', CHR(0)), rq = %d, ka = %s, pc = %s, ac = %d, lpc_acl = %d, banner = %s, location = NVL('%s', CHR(0)), contact = NVL('%s', CHR(0))",
uprn_fields,
16,
- 0,
- 0,
+ "name = '%s'",
+ 1,
NULL,
&uprn_validate,
},