Sqlcode = 0

Sqlcode = 0 DEFAULT

SQLCODE and SQLSTATE

SQLCODE and SQLSTATE are variables in which the DBMS returns ANSI/ISO Entry-92-compliant status codes indicating the results of the last SQL statement that was executed.

SQLCODE Variable

SQLCODE is an integer variable in which the DBMS returns the status of the last SQL statement executed. For details about the requirements for declaring the SQLCODE variable in embedded programs, see the Embedded SQL Companion Guide.

Note:  The ANSI Entry SQL-92 specification describes SQLCODE as a deprecated feature, and recommends using the SQLSTATE variable.

Values Returned by SQLCODE

The values returned in the standalone SQLCODE variable are the same as those returned in the sqlcode member of the SQLCA structure. The value of SQLCODE is meaningful only in the context of a session.

The values returned in SQLCODE are listed in the following table:

Value

Description

0

Successful completion.

+100

No rows were processed by a DELETE, FETCH, INSERT, SELECT, UPDATE, MODIFY, COPY, CREATE INDEX, or CREATE AS...SELECT statement. This value (+100) sets the not found condition of the WHENEVER statement.

+700

A message statement in a database procedure has just executed, setting the sqlmessage condition of the WHENEVER statement.

+710

A database event was raised.

Negative Value

An error occurred. The value of SQLCODE is the negative value of the error number returned to errorno. For information on errorno, see Error Checking Using Inquire Statements. A negative value sets the sqlerror condition of the WHENEVER statement.

SQLSTATE Variable

The SQLSTATE variable is a 5-character string in which the DBMS Server returns the status of the last SQL statement executed. The values returned in SQLSTATE are specified in the ANSI/ISO Entry SQL-92 standard. For details about the requirements for declaring the SQLSTATE variable in embedded programs, see the Embedded SQL Companion Guide.

Note:  If queries are executed while connected (through an Enterprise Access product) to a DBMS server that does not support SQLSTATE, SQLSTATE is set to 5000K (meaning SQLSTATE not available). This result does not necessarily mean that an error occurred. To check the results of the query, use one of the other error-checking methods.

SQLSTATE is not available within database procedures; however, a routine that directly executes a database procedure can check SQLSTATE to determine the result of the procedure call.

The following example illustrates the use of SQLSTATE in an embedded program:

exec sql begin declare section;
     character  SQLSTATE(5)
exec sql end declare section;\
exec sql connect mydatabase;
if SQLSTATE <> "00000" print 'Error on connection!'

For a list mapping Ingres generic errors to SQLSTATE values, see the appendix “SQLSTATE Values and Generic Error Codes.”



Copyright 2021 Actian Corporation. All rights reserved.

 


Sours: https://docs.actian.com/ingres/11.0/SQLRef/SQLCODE_and_SQLSTATE.htm

SQLCODE

(Read-only) The SQLCODE option holds the value returned by the Oracle RDBMS after the most recently attempted SQL operation.

Return Value

INTEGER. after a successful operation, after an error, or after all requested rows have been fetched.

Syntax

SQLCODE

Notes


Signalling Errors

Oracle OLAP does not signal an error when SQLCODE becomes nonzero. Therefore, your program must test the value of SQLCODE and take the appropriate action. Since each SQL operation sets SQLCODE, you must test for errors after each operation to avoid missing an error condition.


Specific Error Codes

You can write programs that look for a specific error code. For example, the most common warning code is , which indicates that the cursor reached the end of its table selection and the FETCH statement is complete.


Error Messages

After an error, the SQLERRM option typically contains an error message.

Examples

Example 22-20 Using SQLCODE When Fetching Data

The following program fragment includes a WHILE loop that tests for the value of SQLCODE and stops trying to fetch data when the end of the cursor's active set is reached.

WHILE SQLCODE EQ 0 SQL FETCH cursor1 INTO :employee, :title
Sours: https://docs.oracle.com/cd/B12037_01/olap.101/b10339/x_sql003.htm
  1. Chicago fire 9x14
  2. 1755 palm st
  3. Ascension in quicker
  4. Itachi sharingan
  5. Clear shoe box

SQLCODE Values

0 The statement ran without error. 1 The statement ran, but a warning was generated. The values of the SQLWARN flags should be checked to determine the type of error. See The SQLCA Data Structure for more information on SQLWARN flags. < 0 (negative) Varies The statement did not run due to an application, database, system, or network error. -1 Autoconnect failure SQL(INIT) was used, and automatic CONNECT failed. Programs which use SQL(INIT) need to check SQLCODE immediately on startup. 100 Data matching the query was not found or the end of the results set has been reached. No rows were processed. -10000 <The first error message returned by the ODBC call SQLError after the OpenESQL run-time module detected an error>

or

See your ODBC driver documentation, or other ODBC reference documents for details of ODBC error messages. SQLSTATE will contain a unique code for each ODBC error condition.  Unable to retrieve ODBC error An ODBC error occurred, but no more details are available. This usually indicates a serious run-time condition, such as severe memory shortage. -19085 Invalid ODBC catalog query This is caused by invalid parameters to a QUERY ODBC statement. -19101 Statement too long   -19199 ESQL Keyword(s) detected in PREPARE/EXECUTE IMMEDIATE statement   -19313 Too few host variables   -19413 Data overflow occurred during decimal data conversion   -19501 No cursor declared   -19514 Cursor is not prepared   -19701 NULL connection name

or

Connection name not found

These two errors (-19701 and -19702) occur when a program refers to a connection which does not exist. The most likely cause is attempting to execute an Embedded SQL statement before a CONNECT has executed successfully, or after all connections have been disconnected. -19702 Connection name not found

or

Attempt to close non-existent connection

-19703 Could not make connection.   -19707 Duplicate connection name.   -19822 Improperly initialized User SQLDA   -19957 Statement text not found or empty   -20000 Unimplemented embedded SQL feature The COBOL compiler may accept some Embedded SQL syntax which is not yet supported by the OpenESQL run-time module. If an attempt is made to execute such a statement, this condition is the result.
Sours: https://www.microfocus.com/documentation/enterprise-developer/ed40/ED-Eclipse/HRDBRHESQL17.html
MySQL Tutorial for Beginners [Full Course]

31.11. Error Handling

This section describes how you can handle exceptional conditions and warnings in an embedded SQL program. There are several nonexclusive facilities for this.

31.11.1. Setting Callbacks

One simple method to catch errors and warnings is to set a specific action to be executed whenever a particular condition occurs. In general:

EXEC SQL WHENEVER ;

can be one of the following:

The specified action is called whenever an error occurs during the execution of an SQL statement.

The specified action is called whenever a warning occurs during the execution of an SQL statement.

The specified action is called whenever an SQL statement retrieves or affects zero rows. (This condition is not an error, but you might be interested in handling it specially.)

can be one of the following:

This effectively means that the condition is ignored. This is the default.


Jump to the specified label (using a C statement).

Print a message to standard error. This is useful for simple programs or during prototyping. The details of the message cannot be configured.

Call , which will terminate the program.

Execute the C statement . This should only be used in loops or statements.


Call the specified C functions with the specified arguments.

The SQL standard only provides for the actions and (and ).

Here is an example that you might want to use in a simple program. It prints a simple message when a warning occurs and aborts the program when an error happens.

EXEC SQL WHENEVER SQLWARNING SQLPRINT; EXEC SQL WHENEVER SQLERROR STOP;

The statement is a directive of the SQL preprocessor, not a C statement. The error or warning actions that it sets apply to all embedded SQL statements that appear below the point where the handler is set, unless a different action was set for the same condition between the first and the SQL statement causing the condition, regardless of the flow of control in the C program. So neither of the two following C program excerpts will have the desired effect.

/* * WRONG */ int main(int argc, char *argv[]) { ... if (verbose) { EXEC SQL WHENEVER SQLWARNING SQLPRINT; } ... EXEC SQL SELECT ...; ... } /* * WRONG */ int main(int argc, char *argv[]) { ... set_error_handler(); ... EXEC SQL SELECT ...; ... } static void set_error_handler(void) { EXEC SQL WHENEVER SQLERROR STOP; }

31.11.2. sqlca

For more powerful error handling, the embedded SQL interface provides a global variable with the name that has the following structure:

struct { char sqlcaid[8]; long sqlabc; long sqlcode; struct { int sqlerrml; char sqlerrmc[70]; } sqlerrm; char sqlerrp[8]; long sqlerrd[6]; char sqlwarn[8]; char sqlstate[5]; } sqlca;

(In a multithreaded program, every thread automatically gets its own copy of . This works similarly to the handling of the standard C global variable .)

covers both warnings and errors. If multiple warnings or errors occur during the execution of a statement, then will only contain information about the last one.

If no error occurred in the last statement, will be 0 and will be . If a warning or error occurred, then will be negative and will be different from . A positive indicates a harmless condition, such as that the last query returned zero rows. and are two different error code schemes; details appear below.

If the last SQL statement was successful, then contains the OID of the processed row, if applicable, and contains the number of processed or returned rows, if applicable to the command.

In case of an error or warning, will contain a string that describes the error. The field contains the length of the error message that is stored in (the result of , not really interesting for a C programmer). Note that some messages are too long to fit in the fixed-size array; they will be truncated.

In case of a warning, is set to . (In all other cases, it is set to something different from .) If is set to , then a value was truncated when it was stored in a host variable. is set to if any of the other elements are set to indicate a warning.

The fields , , , and the remaining elements of and currently contain no useful information.

The structure is not defined in the SQL standard, but is implemented in several other SQL database systems. The definitions are similar at the core, but if you want to write portable applications, then you should investigate the different implementations carefully.

31.11.3. vs

The fields and are two different schemes that provide error codes. Both are derived from the SQL standard, but has been marked deprecated in the SQL-92 edition of the standard and has been dropped in later editions. Therefore, new applications are strongly encouraged to use .

is a five-character array. The five characters contain digits or upper-case letters that represent codes of various error and warning conditions. has a hierarchical scheme: the first two characters indicate the general class of the condition, the last three characters indicate a subclass of the general condition. A successful state is indicated by the code . The codes are for the most part defined in the SQL standard. The PostgreSQL server natively supports error codes; therefore a high degree of consistency can be achieved by using this error code scheme throughout all applications. For further information see Appendix A.

, the deprecated error code scheme, is a simple integer. A value of 0 indicates success, a positive value indicates success with additional information, a negative value indicates an error. The SQL standard only defines the positive value +100, which indicates that the last command returned or affected zero rows, and no specific negative values. Therefore, this scheme can only achieve poor portability and does not have a hierarchical code assignment. Historically, the embedded SQL processor for PostgreSQL has assigned some specific values for its use, which are listed below with their numeric value and their symbolic name. Remember that these are not portable to other SQL implementations. To simplify the porting of applications to the scheme, the corresponding is also listed. There is, however, no one-to-one or one-to-many mapping between the two schemes (indeed it is many-to-many), so you should consult the global listing in Appendix A in each case.

These are the assigned values:

-12 ()

Indicates that your virtual memory is exhausted. (SQLSTATE YE001)

-200 ()

Indicates the preprocessor has generated something that the library does not know about. Perhaps you are running incompatible versions of the preprocessor and the library. (SQLSTATE YE002)

-201 ()

This means that the command specified more host variables than the command expected. (SQLSTATE 07001 or 07002)

-202 ()

This means that the command specified fewer host variables than the command expected. (SQLSTATE 07001 or 07002)

-203 ()

This means a query has returned multiple rows but the statement was only prepared to store one result row (for example, because the specified variables are not arrays). (SQLSTATE 21000)

-204 ()

The host variable is of type and the datum in the database is of a different type and contains a value that cannot be interpreted as an . The library uses for this conversion. (SQLSTATE 42804)

-205 ()

The host variable is of type and the datum in the database is of a different type and contains a value that cannot be interpreted as an . The library uses for this conversion. (SQLSTATE 42804)

-206 ()

The host variable is of type and the datum in the database is of another type and contains a value that cannot be interpreted as a . The library uses for this conversion. (SQLSTATE 42804)

-211 ()

This means the host variable is of type and the datum in the database is neither nor . (SQLSTATE 42804)

-212 ()

The statement sent to the PostgreSQL server was empty. (This cannot normally happen in an embedded SQL program, so it may point to an internal error.) (SQLSTATE YE002)

-213 ()

A null value was returned and no null indicator variable was supplied. (SQLSTATE 22002)

-214 ()

An ordinary variable was used in a place that requires an array. (SQLSTATE 42804)

-215 ()

The database returned an ordinary variable in a place that requires array value. (SQLSTATE 42804)

-220 ()

The program tried to access a connection that does not exist. (SQLSTATE 08003)

-221 ()

The program tried to access a connection that does exist but is not open. (This is an internal error.) (SQLSTATE YE002)

-230 ()

The statement you are trying to use has not been prepared. (SQLSTATE 26000)

-240 ()

The descriptor specified was not found. The statement you are trying to use has not been prepared. (SQLSTATE 33000)

-241 ()

The descriptor index specified was out of range. (SQLSTATE 07009)

-242 ()

An invalid descriptor item was requested. (This is an internal error.) (SQLSTATE YE002)

-243 ()

During the execution of a dynamic statement, the database returned a numeric value and the host variable was not numeric. (SQLSTATE 07006)

-244 ()

During the execution of a dynamic statement, the database returned a non-numeric value and the host variable was numeric. (SQLSTATE 07006)

-400 ()

Some error caused by the PostgreSQL server. The message contains the error message from the PostgreSQL server.

-401 ()

The PostgreSQL server signaled that we cannot start, commit, or rollback the transaction. (SQLSTATE 08007)

-402 ()

The connection attempt to the database did not succeed. (SQLSTATE 08001)

100 ()

This is a harmless condition indicating that the last command retrieved or processed zero rows, or that you are at the end of the cursor. (SQLSTATE 02000)

Sours: https://www.postgresql.org/docs/8.2/ecpg-errors.html

0 sqlcode =

Error Handling Using the SQLCA

User-defined error, message and dbevent handlers offer the most flexibility for handling errors, database procedure messages, and database events. For more information, see Advanced Processing.

However, you can do error handling with the SQLCA implicitly by using whenever statements, or explicitly by checking the contents of the SQLCA fields sqlcode, sqlerrd, and sqlwarn0.

Error Handling with the Whenever Statement

The syntax of the whenever statement is:

exec sql whenevercondition action;

condition

Specifies the error condition. Valid error conditions are dbevent, sqlwarning, sqlerror, sqlmessage, and not found.

action

Specifies the action to be taken. Valid actions are continue, stop, goto a label, and call a C procedure.

For a detailed description of this statement, see the SQL Reference Guide.

In C, all labels and procedure names must be legal C identifiers, beginning with an alphabetic character or an underscore. If the label is an embedded SQL reserved word, specify it in quotes. The label targeted by the goto action must be in the scope of all subsequent embedded SQL statements until another whenever statement is encountered for the same action. This is necessary because the preprocessor may generate the C statement:

if (condition) goto label;

after an embedded SQL statement. If the scope of the label is invalid, the C compiler generates an error.

The same scope rules apply to procedure names used with the call action. The reserved procedure sqlprint, which prints errors or database procedure messages and then continues, is always in the scope of the program. When a whenever statement specifies a call as the action, the target procedure is called, and after its execution, control returns to the statement following the statement that caused the procedure to be called. Consequently, after handling the whenever condition in the called procedure, you may want to take some action, instead of merely issuing a C return statement. The C return statement causes the program to continue execution with the statement following the embedded SQL statement that generated the error.

You can also use user-defined handlers for error handling. For more information, see the SQL Reference Guide.

The following example demonstrates use of the whenever statement in the context of printing some values from the Employee table. The comments do not relate to the program but to the use of error handling.

Example: whenever statement usage

exec sql include sqlca;

Db_Test()

{
    exec sql begin declare section;
         short eno;
         char ename[21];
         char age;
    exec sql end declare section;
       exec sql declare empcsr cursor for
         select eno, ename, age
         from employee;
    /*
    ** An error when opening the personnel database will

    ** cause the error to be printed and the program

    ** to abort.

    */

    exec sql whenever sqlerror stop;

    exec sql connect personnel;

    /* Errors from here on will cause the program to

    ** clean up

    */

    exec sql whenever sqlerror call Clean_Up;

    exec sql open empcsr;

    printf("Some values from the \"employee\" table.\n");

    /*

    ** When no more rows are fetched, close the cursor

    */

    exec sql whenever not found goto close_csr;

    /*

    ** The last executable embedded SQL statement was an

    ** OPEN, so we know that the value of "sqlcode"

    ** cannot be SQLERROR or NOT FOUND.

    */

    while (1) /* Loop is broken by NOT FOUND */

    {

        exec sql fetch empcsr

            into :eno, :ename, :age;

            /*

            ** This "printf" does not execute after the

            ** previous FETCH returns the NOT FOUND

            ** condition.

            */

            printf("%d, %s, %d\n", eno, ename, age);

    }

    /*

    ** From this point in the file onwards, ignore all

    ** errors. Also turn off the NOT FOUND condition,

    ** for consistency

    */

    exec sql whenever sqlerror continue;

    exec sql whenever not found continue;

 Close_Csr:

    exec sql close empcsr;

    exec sql disconnect;

 }

/*

** Clean_Up: Error handling procedure (print error and disconnect).

*/

Clean_Up()

{

    exec sql begin declare section;

        char errmsg[101];

    exec sql end declare section;

    exec sql inquire_sql (:errmsg = ERRORTEXT);

    printf("Aborting because of error:\n%s\n", errmsg);

    exec sql disconnect;

    exit(-1); /* Do not return to Db_Test */

}

Whenever Goto Action In Embedded SQL Blocks

An embedded SQL block-structured statement is delimited by the words begin and end. For example, the select loop and unloadtable loops are all block-structured statements. You can only terminate these statements by the methods specified for the particular statement in the SQL Reference Guide. For example, the select loop is terminated either when all the rows in the database result table are processed or by an endselect statement. The unloadtable loop is terminated either when all the rows in the forms table field are processed or by an endloop statement.

Therefore, if you use a whenever statement with the goto action in an SQL block, you must avoid going to a label outside the block. Such a goto causes the block to be terminated without issuing the runtime calls necessary to clean up the information that controls the loop. (For the same reason, you must not issue a C return or goto statement that causes control to leave or enter the middle of an SQL block.) The target label of the whenever goto statement should be a label in the block. However, if it is a label for a block of code that cleanly exits the program, the above precaution need not be taken.

The above information does not apply to error handling for database statements issued outside an SQL block, or to explicit hard-coded error handling. See the example of hard-coded error handling in The Table Editor Table Field Application.

Explicit Error Handling

Programs can also handle errors by inspecting values in the SQLCA structure at various points. For further details, see the SQL Reference Guide.

The following example is functionally the same as the previous example, except that the error handling is hard-coded in C statements.

Example: Explicit error handling

exec sql include sqlca;

# define NOT_FOUND 100

Db_Test()
{
    exec sql begin declare section;
        short eno;
        char ename[21];
        char age;
    exec sql end declare section;

    exec sql declare empcsr cursor for
        select eno, ename, age
        from employee;

    /* Exit if database cannot be opened */
    exec sql connect personnel;
    if (sqlca.sqlcode < 0)
    {
        printf("Cannot access database.\n");
        exit(-1);
    }
/* Error if cannot open cursor */
exec sql open empcsr;
 if (sqlca.sqlcode < 0)
    Clean_Up("OPEN \"empcsr\"");

printf("Some values from the \"employee\"
    table.\n");

/*
** The last executable embedded SQL statement was an OPEN, so we know
** that the value of "sqlcode" cannot be SQLERROR or NOT FOUND.
*/
while (sqlca.sqlcode == 0)
/* Loop broken by NOT FOUND */
{

        exec sql fetch empcsr
            into :eno, :ename, :age;

        if (sqlca.sqlcode < 0)
             Clean_Up("FETCH <"empcsr\"");

        /* Do not print the last values twice */
        else if (sqlca.sqlcode != NOT_FOUND)
        printf("%d, %s, %d\n", eno, ename, age);
    }

    exec sql close empcsr;
    exec sql disconnect;

}

/*
** Clean_Up: Error handling procedure
*/

Clean_Up(stmt)
 char *stmt;
 {
    exec sql begin declare section;
        char *err_stmt = stmt;
        char errmsg[101];
    exec sql end declare section;

    exec sql inquire_sql (:errmsg = ERRORTEXT);
    printf("Aborting because of error in %s:\n%s\n",
        err_stmt, errmsg);
    exec sql disconnect;

    exit(-1); /* Do not return to Db_Test */
}

How to Determine the Number of Affected Rows

The third element of the SQLCA array sqlerrd indicates how many rows were affected by the last row-affecting statement. This element is referenced by sqlerrd[2] rather than sqlerrd[3] as in other languages, because C subscripts begin at number 0.

The following program fragment, which deletes all employees whose employee numbers are greater than a given number, demonstrates how to use sqlerrd.

Example: sqlerrd usage

exec sql include sqlca;
 Delete_Rows(lower_bound)
 int lower_bound;
 {
    exec sql begin declare section;
        int lower_bound_num = lower_bound;
    exec sql end declare section;

    exec sql delete from employee
        where eno > :lower_bound_num;

    /* Print the number of employees deleted */
    printf("%d row(s) were deleted.\n",
     sqlca.sqlerrd[2]);
    }



Copyright 2021 Actian Corporation. All rights reserved.

 


Sours: https://docs.actian.com/ingres/11.0/EmbedSQL/Error_Handling_Using_the_SQLCA.htm
DB2 Cursor \u0026 SQLCODE 305 Theory

Why sqlca.sqlcode always 0 when use Update Statement

Norman's profile photo

Norman

unread,
Sep 22, 1999, 10:00:00 AM9/22/99

Reply to author

Sign in to reply to author

Forward

Sign in to forward

Delete

Link

Report message as abuse

Sign in to report message as abuse

Show original message

Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message

to


Hi PB Experts:
In Powerscrpit ,I try to detect update sqlcode then do something
But sqlca.sqlcode always is 0 ,Why .
My scrpit like this :
UPDATE paym040
SET surecode = :ls_surecode,
userno = :ls_sur_empno
WHERE ( paym040.empno = " ") AND
( paym040.bonusyymm = :ls_yymm ) AND
( paym040.times = :ls_times ) AND
( paym040.recid = :ls_recid ) ;

If sqlca.sqlcode <> 0 Then
Rollback;
MessageBox("","Fail.....")
Else
commit ;
MessageBox("',"success....")
End If

Thank U !

Enrico Chiaramonte's profile photo

Enrico Chiaramonte

unread,
Sep 22, 1999, 10:00:00 AM9/22/99

Reply to author

Sign in to reply to author

Forward

Sign in to forward

Delete

Link

Report message as abuse

Sign in to report message as abuse

Show original message

Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message

to


Are you sure?
Sqlcode is 0 if any error occurs... for example the table not exist... or
you try to assign a string int a number field.
But if your update didn't find any row is not an error...
You can check also sqlca.sqlnrows (but is not supported from all db!) for
see how many rows you had proceded.

Enrico

Sorry for my english
Norman <[email protected]> wrote in message
[email protected]

Mark J. Pfeifer[TeamSybase]'s profile photo

Mark J. Pfeifer[TeamSybase]

unread,
Sep 22, 1999, 10:00:00 AM9/22/99

Reply to author

Sign in to reply to author

Forward

Sign in to forward

Delete

Link

Report message as abuse

Sign in to report message as abuse

Show original message

Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message

to


In article <[email protected]>, [email protected]


> Hi PB Experts:
> In Powerscrpit ,I try to detect update sqlcode then do something
> But sqlca.sqlcode always is 0 ,Why .
> My scrpit like this :
> UPDATE paym040
> SET surecode = :ls_surecode,
> userno = :ls_sur_empno
> WHERE ( paym040.empno = " ") AND
> ( paym040.bonusyymm = :ls_yymm ) AND
> ( paym040.times = :ls_times ) AND
> ( paym040.recid = :ls_recid ) ;
>
> If sqlca.sqlcode <> 0 Then
> Rollback;
> MessageBox("","Fail.....")
> Else
> commit ;
> MessageBox("',"success....")
> End If
>
> Thank U !
>
>
>

Norman -

Have you tried getting it to fail - is that how you know it is always
zero? Does the DB get updated?

Altry try "USING SQLCA" at the end of the statement. You might also want
to take a look at the examples for dynamic sql. There are a couple
options.

HTH
Mark
TeamSybase

--

Mark Pfeifer Corporate Technology Partners, Inc.
Emerging Technology Solutions
[email protected] sprynet.comwww.ctpartners.com

Norman's profile photo

Norman

unread,
Sep 26, 1999, 10:00:00 AM9/26/99

Reply to author

Sign in to reply to author

Forward

Sign in to forward

Delete

Link

Report message as abuse

Sign in to report message as abuse

Show original message

Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message

to


Thank U Sir :

I try "USING SQLCA" , and debug it I get result :
sqlca.sqlcode = 0
sqlca.sqldbcode = 0
sqlnrows = 1

I use INFORMIX 7.X ON-Line And PB6.0!

Mark J. Pfeifer[TeamSybase] 撰寫於文章 ...

Norman's profile photo

Norman

unread,
Sep 26, 1999, 10:00:00 AM9/26/99

Reply to author

Sign in to reply to author

Forward

Sign in to forward

Delete

Link

Report message as abuse

Sign in to report message as abuse

Show original message

Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message

to


Thank U Sir :

I had tried "USING SQLCA" , and debug it ,I got result :
sqlca.sqlcode = 0


sqldbcode = 0
sqlnrows = 1

I make sure that variable 'ls_yymm' and 'ls_recid' not exist in table
"paym040".

I use PB6.0 & Informix 7.x On-Line

Sours: https://groups.google.com/

You will also be interested:

The SQLCODE variable

The IBM® Informix® ESQL/C header file, sqlca.h, declares SQLCODE as a global variable. Since the Informix ESQL/C preprocessor automatically includes sqlca.h in the Informix ESQL/C program, you do not need to declare SQLCODE.

When the database server executes an SQL statement, the database server automatically updates the SQLCODEvariable as follows:
  1. The database server stores the exception value in the sqlcode field of the sqlca structure.
  2. Informix ESQL/C copies the value of sqlca.sqlcode to the global SQLCODE variable.

Tip: For readability and brevity, use SQLCODE in your Informix ESQL/C program in place of sqlca.sqlcode.

The SQLCODEvalue can indicate the following types of exceptions:
SQLCODE = 0
Success
SQLCODE = 100
NOT FOUND condition
SQLCODE < 0
Runtime error

For a description of an error message, use the finderr utility or go to Error messages.

Sours: https://informix.hcldoc.com/12.10/help/topic/com.ibm.esqlc.doc/ids_esqlc_0408.htm


503 504 505 506 507