Re: Locks and ESQL/C question (long)
Posted in 1994
}From: eelconi@xs4all.hacktic.nl (eelconi)
}Subject: Locks and ESQL/C question (long)
}Date: 23 Jun 1994 10:46:13 +0200
}X-Informix-List-Id: <news.7324>
}We have got a problem with locks when programming in ESQL/C.
} ... Lots of useful info, including version numbers (thank you) omitted...
}We inspected the .c files the esql compiler generates to figure out what
}we could do to solve the problem:
}.ec file:
} $whenever sqlerror call err_sql
} ...
} $fetch article
} ...
}As an experiment we changed directly in the .c file:
}{
} static _FetchSpec _FS0 = { 0, 1, 0 };
}xxyzz:
} _iqcftch(_iqlocate_cursor(article, 0, 1, 0), (struct sqlda *)0,
} (struct sqlda *)0, (char *)0, &_FS0);
} if (SQLCODE < 0) {
} err_sql();
} goto xxyzz;
} }
}}
}This worked fine ! From within err_sql we can now control what has to
}be done when encountering a lock.
}But programming directly in the .c files is not exactly the way to do it IMHO,
}so does anyone have an idea how we could solve this problem in another way ??
So, write the code you want executed in ESQL/C:
$ whenever sqlerror call err_sql;
...
SQLCODE = -1;
while (SQLCODE < 0)
{
$ fetch article;
}
...
Or am I overlooking something obvious?
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>