In case two messages (warning and an error) are received from the same SQL the errcode returned in the sqlca structure seems to the first one raised...

In case the first message is a warning (let us say "attempt to insert non-null value into a timestamp field") and the second an error (let us say "duplicate insert") the error code returned in the sqlca.sqlcode is that of the warning and not of the "duplicate insert".

however under the normal SQL operation the @@errorcode returned is "duplicate insert".

In there a way in which the warnings can be that I could get the "duplicate insert" error returned.