Re: API for error codes.
Posted in 1995
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
In article <3lpespINNp1h@afshub.boulder.ibm.com>, rahulv@cyst.glta.ibm.com () writes: |> Hello, |> |> Is there an way to get Informix database error codes within a |> program ? I know that one can use finderr to find out detail |> information about Informix error message. What I am looking for |> is some kind of APIs which I can call from my program, and the |> API returns a string containing detail information about the |> error message. |> |> Any help ? |> Regards |> Rahul Vadodkar |> (616)954-7052 If you are using ESQL/C You can use rgetlmsg() function. You may also want to look at the field sqlerrm in sqlca structure. A typical example would be rgetlmsg(code, message, sizeof(message) &len) where code is the SQLCODE in case of error, message is a buffer to hold the error message returned by informix, len is the length returned by informix. After this you can say printf(message, sqlca.sqlerrm); Hope this helps Satish ---------------- V.R. Satish Satish@twinsun.com