Interview Questions   Tutorials   Discussions   Programs   

DB2 - What are db2 error codes -305 and -407. What is the difference between these 2 error codes ?




428
views
asked mar August 25, 2014 12:09 PM  

What are db2 error codes -305 and -407. What is the difference between these 2 error codes ?


           

1 Answers



 
answered By Mswami   0  
-305:
THE NULL VALUE CANNOT BE ASSIGNED TO OUTPUT HOST VARIABLE NUMBER position-number BECAUSE NO INDICATOR VARIABLE IS SPECIFIED.

Explanation:

A FETCH, SELECT, VALUES INTO, or SET assignment statement resulted in the retrieval of a null value to be inserted into the output host variable, designated by entry number 'position-number' of the output SQLDA, for which no indicator variable was provided. An indicator variable must be supplied if a column returns a null value.

System action:

The statement cannot be processed. No data was retrieved.

Programmer response:

Examine the definition of the table that is the object of the statement and correct the application program to provide indicator variables for all host variables into which null values can be retrieved. This includes host variables for columns which can contain null values and host variables which receive the results of aggregate functions whose result table could be empty.


-407:
AN UPDATE, INSERT, OR SET VALUE IS NULL, BUT THE OBJECT COLUMN column-name CANNOT CONTAIN NULL VALUES.

Explanation:

One of the following conditions occurred:

  •     A null insert or update value was specified for a column defined as NOT NULL.
  •     A SET transition variable statement specified a NULL value for column defined as NOT NULL without the WITH DEFAULT clause in the table definition.
  •     The update or insert value was DEFAULT, but the object column was declared as NOT NULL without WITH DEFAULT in the table definition. Consequently:
    •  A default value of NULL cannot be inserted into that column.
    •  An update cannot set default values of NULL in that column.
    •  A SET transition variable statement in a trigger cannot set default values of NULL in that column.
  •     The column name list for the INSERT statement omits a column declared NOT NULL and without WITH DEFAULT in the table definition.
  •     The view for the INSERT statement omits a column declared NOT NULL and without WITH DEFAULT in the base table definition.
  •     A null insert value was specified for a ROWID column.

System action:

The statement cannot be processed. The 'column-name' might be returned in the SQLCA, depending on the syntax of the SQL statement in which the error was detected.

Programmer response:

Examine the definition of the object table to determine which columns of the table have the NOT NULL attribute or have a type of ROWID, and correct the SQL statement accordingly.
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert