if ((mr_errcode = prefetch_value(q, argv, cl)) != MR_SUCCESS)
return mr_errcode;
- /* If this is an UPDATE query, we're done. */
+ /* If this is an MR_Q_UPDATE query, we're done. */
if (row == 2)
return MR_SUCCESS;
char *account_number;
/* Check for asnt or usnt. */
- if (q->type == APPEND)
+ if (q->type == MR_Q_APPEND)
row = 0;
else
row = 1;
* from within a setup_...() routine with the appropriate arguments.
*
* Correct functioning of this routine may depend on the assumption
- * that this query is an APPEND.
+ * that this query is an MR_Q_APPEND.
*/
int prefetch_value(struct query *q, char **argv, client *cl)
if (sqlca.sqlerrd[2] != 1)
return MR_INTERNAL;
- argc = q->argc + q->vcnt; /* end of Argv for APPENDs */
+ argc = q->argc + q->vcnt; /* end of Argv for MR_Q_APPENDs */
sprintf(argv[argc], "%d", value);
return MR_SUCCESS;
EXEC SQL END DECLARE SECTION;
/* Check for aprn or uprn. */
- if (q->type == APPEND)
+ if (q->type == MR_Q_APPEND)
row = 0;
else
row = 1;
return MR_BAD_CHAR;
else
{
- if (q->type == APPEND)
+ if (q->type == MR_Q_APPEND)
{
EXEC SQL SELECT COUNT(name) INTO :count FROM printers
WHERE name = :name OR duplexname = :name;
if (*duplexname)
{
- if (q->type == APPEND)
+ if (q->type == MR_Q_APPEND)
{
EXEC SQL SELECT COUNT(name) INTO :count FROM printers
WHERE name = :duplexname OR duplexname = :duplexname;
return 1;
}
+int setup_aali(struct query *q, char *argv[], client *cl)
+{
+ EXEC SQL BEGIN DECLARE SECTION;
+ int cnt;
+ char *name, *type, *trans;
+ EXEC SQL END DECLARE SECTION;
+ name = argv[0];
+ type = argv[1];
+ trans = argv[2];
+
+ if (strcmp(strtrim(type), "FILESYS"))
+ return MR_SUCCESS;
+
+ EXEC SQL SELECT count(label) INTO :cnt FROM filesys WHERE
+ label = :name;
+ if (cnt > 0)
+ return MR_EXISTS;
+
+ return MR_SUCCESS;
+}
+
int setup_acon(struct query *q, char *argv[], client *cl)
{
EXEC SQL BEGIN DECLARE SECTION;