Re: ESQL-C - Errormessages
Posted in 1994
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration, Migration, Import/Export & Data Conversion
} } } Hello Informix users from the "C" world! } } I have a problem to get the correct error messages in to my "C" world. } } When using the "rgetmsg"-function (ESQL/C, p7-13), I get e.g. the following result: } } The specified table (%s) is not in the database } } My problem is how to resolve the %s with the name of the missing table. } Dbaccess DOES show the correct name (where does it get the name from?)! } The Manuals are not telling me where to find the name. } } } Of course for this easy case of a missing table it is not so important } but when violating a constraint I want to be informed what constraint is } violated. } } Btw, we are using Informix 5.0 . } } -- } ========================================================================== } / Achim Reiners Software Engineering \\ } | /M/A/I Deutschland GmbH | } | Softwarezentrum Koeln Phone: +49 221 956400-40 | } | Mathias-Brueggen-Str. 85 Fax: +49 221 956400-69 | } \\ 50829 Koeln E-Mail: ar@mai.de / } \\_________________________________________________________________________/ } Hai Achim , The Value for the format is stored in sqlca.sqlerrm. The following is a esqlc errlog function which shows the usage of rgetmsg. static M_sql_errlog (in_str,line) char *in_str; int line; { fprintf (errfp ,"ERROR:%d:line %d:%s\\n",sqlca.sqlcode,line,in_str); rgetmsg (sqlca.sqlcode,tmpbuf,160); if (sqlca.sqlerrd[4]) fprintf (errfp ,"position:%d\\n",sqlca.sqlerrd[4]); fprintf (errfp ,tmpbuf,sqlca.sqlerrm); // sqlca.sqlerrm contains string for // rgetmsg's format resolution fflush(errfp); } +--------------------------+---------------------------+ | G.T.Madavan, | e-mail: gtmad@smi.mn.org | | Systems Migration Inc., | Phone : (612) 890-0040 | | Burnsville, MN, U.S.A | Fax : (612) 890-0966 | +--------------------------+---------------------------+