Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Wrong values in sqlca.sqlcode, SQLCODE, and SQLSTATE

Wrong values in sqlca.sqlcode, SQLCODE, and SQLSTATE

From: Burkhard Schultheis <bschultheis_at_tde.ra.eunet.de>
Date: Thu, 01 Oct 1998 16:18:42 +0200
Message-ID: <36138F42.A6B298D7@tde.ra.eunet.de>


Hello everybody,

I'm developing with the following environment: DEC UNIX V4.0,
Oracle V7.3.2.1.0

Here is my test program:

EXEC SQL INCLUDE sqlca;

EXEC SQL BEGIN DECLARE SECTION;
 char *uid = "lzgneu/lzg";
 long SQLCODE;
 int a;
EXEC SQL END DECLARE SECTION;  char SQLSTATE [6];

void main (void)
{

    EXEC SQL CONNECT :uid;

    printf ("sqlca.sqlcode: %ld, SQLCODE: %ld, SQLSTATE: %s\n",

        sqlca.sqlcode, SQLCODE, SQLSTATE);

    EXEC SQL SELECT * INTO :a FROM lzgneu.test;     printf ("sqlca.sqlcode: %ld, SQLCODE: %ld, SQLSTATE: %s\n",

        sqlca.sqlcode, SQLCODE, SQLSTATE); }

Table test is created as
Create table test (a integer);
Table test is empty.

I compiled this program with
proc sqlcheck=full userid=lzgneu/lzg auto_connect=yes mode=ansi iname=test.pc
and
cc -Wl,-rpath,/db/oracle/lib -o testoracle -g -I/db/oracle/precomp/public -L/db/oracle/lib -lclntsh -ldnet_stub test.c

The output from this program is as follows:

sqlca.sqlcode: 0, SQLCODE: 0, SQLSTATE: sqlca.sqlcode: 3544382665317613593, SQLCODE: 3544382665317613593, SQLSTATE: Why I get so silly values? I have checked sizeof (sqlca.sqlcode): 8. Who

can help?
Thank you!
--
Burkhard Schultheis
Tele Data Electronic Received on Thu Oct 01 1998 - 09:18:42 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US