"hobbes" <pasdespam@yahoo.fr> wrote
> with ESQL/C
> As all my "C" program are services, i would like to log error to
"maybe"
> interact with it .
> But what i'm trying to obtain unsuccessfully for some day now, is to
get the
> text of the last query that generates an error !
>
> eg: in the code there is an
> exec sql select a,b from alpha;
>
> then I check the result of the command.
> (b is not in the table)
> so => error i got the message : "Error : Column(b) not foun in any
table in
> the query"
>
> but since our whole code is pretty huge, it would be great to have
the query
> that make the error : "select a,b from alpha"
>
> so we can pretty easely diagnose what the error is exactly and the
gravity
> of it.
> In that case it's just the name of the column we can say it would
take 5mn
> of correction , 5 mn of compilation, and 5-10 mn of test(if we're
nor
> sure... :)).
>
> we're doing this with all the database we work with.
> So i think that i just missing the thing and that Informix have
structure
> for this....
> (but i can't find information about this ... i try but i can't ...)
I don't know if/how that may be done via ESQL/C,
but if you have DBA access, you may try with:
1) stop program with the connection still open
2) onstat -g ses to identify the session
3) onstat -g sql <session-id> to look at last SQL code
(hoping there is enough room for everything... ;-) )
Umberto