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

Home -> Community -> Usenet -> c.d.o.server -> WHENEVER SQLWARNING? in Pro*C

WHENEVER SQLWARNING? in Pro*C

From: Jorge A. San Martín <jsanmart_at_tortuga.its.cl>
Date: 1997/11/18
Message-ID: <34721C9F.2D26357A@tortuga.its.cl>#1/1

Hi,
 I have a problem with the WHENEVER SQLWARNING statement, I wrote the following code

    EXEC SQL WHENEVER SQLERROR DO sqlerror();     EXEC SQL WHENEVER SQLWARNING DO sqlerror();
....

    EXEC SQL select column from table;

in which I mispell the column name and unfortunately the proc doesn't detect the error that the column name is wrong. When I compile, the proc doesn´t detect the column doesn't exist in the table, and in execution the error is not detected also. I looked at the generated .c and it looks like this:

    sqlstm.stmt = "select column from table";
....

    sqlstm.sqparm = sqlstm.sqharm;
    sqlstm.sqparc = sqlstm.sqharc;
    sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);

    if (sqlca.sqlcode < 0) sqlerror();                <--- DOES NOT
REALIZE OF THE ERROR
    if (sqlca.sqlwarn[0] == 'W') sqlerror();       <--- DOES NOT REALIZE
OF THE ERROR Does any Oracle Guru out there have any idea of what the problem is? How can I detect this kind of errors?
SQLCA was declared, so it should be OK.

thanxs a lot, please reply to:

    jsanmart_at_dcc.uchile.cl or jsanmart_at_its.cl

        Jorge A. San Martín Received on Tue Nov 18 1997 - 00:00:00 CST

Original text of this message

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