Re: Pro*C error message location ?

From: <mkrolewski_at_rosetta.org>
Date: Fri, 10 Nov 2000 01:41:44 GMT
Message-ID: <8ufjon$tkk$1_at_nnrp1.deja.com>


In article <8tsopc$8$1_at_relay1.dsccc.com>,   jstrange_at_imtn.dsccc.com (John Strange) wrote:
> Some where along the line, Oracle decided to add
> sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);
>
> to the end of a EXEC SQL any_command_here ;
> in the Pro*C pre-processor.
>
> One of the effects of this is that it nulls out
> sqlca.sqlerrm.sqlerrmc
> which contains the failure reason when the command fails.
>
> Does anyone know where else I can get an EXEC SQL failure message?
>
> --
> While Alcatel may claim ownership of all my ideas (on or off the job),
> Alcatel does not claim any responsibility for them. Warranty expired
 when u
> opened this article and I will not be responsible for its contents or
 use.
>

Actually, this is not what is being done.

After the execution of any command, sqlca is populated with information on the performance of the previous command.

sqlca.sqlerrm.sqlerrmc is populated if an Oracle exception is encountered. Most of the time, if you code is running well, no message is generated.

The sqlca.sqlcode is generally 0 if the operation is successful and nonzero  if not. This is you best detection of problems. Also, remember not all error states are bad. At the end of a fetch, Oracle returns a error code that no more rows are available to be fetched ( -1403 or 100). Obviously this should happen when a cursor is completely fetched.

Also the sqlca need specific headers added to each file that it is used in and initialization in at least one file. Check the manuals.

Also the error messages on the Oracle CD has all the error codes.

Michael Krolewski

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Nov 10 2000 - 02:41:44 CET

Original text of this message