Re: ESQL-C - Errormessages
Posted in 1994
ar@mai.de (Achim Reiners): Achim> Hello Informix users from the "C" world! Achim> I have a problem to get the correct error messages in to my "C" world. Achim> When using the "rgetmsg"-function (ESQL/C, p7-13), I get e.g. the following result: Achim> The specified table (%s) is not in the database Achim> My problem is how to resolve the %s with the name of the missing table. Achim> Dbaccess DOES show the correct name (where does it get the name from?)! Achim> The Manuals are not telling me where to find the name. Achim> Of course for this easy case of a missing table it is not so important Achim> but when violating a constraint I want to be informed what constraint is Achim> violated. Achim> Btw, we are using Informix 5.0 . I do: char lbuf[512], rbuf[512]; rgetmsg(sqlcode, lbuf, 512); if (sqlca.sqlerrm[0]) sprintf(rbuf, lbuf, sqlca.sqlerrm); else strcpy(rbuf, lbuf); return rbuf; Of course this assumes that there is only one format directive in the string returned by rgetmsg, and I've never seen any documentation. (in 4.10). Anyone got any more info? -- Cheers Bill =========================================================================== | Bill Hails <bill@tardis.co.uk> | Reisner's rule of conceptual inertia: | | C.L.I. Connect Ltd. | | | 19, Quarry St., Guildford, Surrey | If you think big enough, you'll never | | GU1 3UY. Tel (UK) 0483 300 200 | have to do it. | ===========================================================================