How to resolve the -305 error code in DB2?
And also please let me know, how to resolve the db2 error
codes.
Answer Posted / daphne
Before going to the solution, here is the explanation of a
null indicator.
In DB2, a NULL is stored using a special one-byte null
indicator which is attached to every NULLABLE column. If
the column is defined as NULL, then the indicator field is
used to record this. The indicator variable is transparent
to an end user, but must be provided for when programming
in a host language.
A positive value or a value of 0 means the column is not
null and any actual value stored in the column is valid. A
negative value indicates that the column is set to null. If
the value is -2 then the column was set to null as the
result of a data conversion error. The default is null.
There are two reasons for getting -305.
1) As said in the first answer if the table column is
defined as NOT NULL (with no default) and if we try to
insert a null value we get that.
- This should be resolved by making sure the inserted
value is not null. Null indicator cannot be used here since
the column is defined as NOT NULL.
2) A table column is defined as NULL:
The host variable has a not null value. The Null
indicator is not set in the host program, so the null
indicator is defaulted to a negative value.
- This should be resolved by using a null indicator in
the host program and moving the relevant value to the null
indicator.
Is This Answer Correct ? | 55 Yes | 5 No |
Post New Answer View All Answers
What is the reason behind not using select * in embedded sql programs?
What is a collection in db2?
What is db2 connect?
What is the difference between nvl and coalesce?
What is the purpose of rollback and commit?
I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.
How to connect to db2 database from windows command line?
What does db2 blu stand for?
Explain the benefits you can get from mainframe connect?
what is diffrence b/w file-aid tool and file-aid utility???
have 3 tables table1, table2 and table3 which contains employee information. table1 is master table, table2 contains emp details like emp no and so on, table 3 contains emp salary. so if any emp leave company between 25th - 30th of every month it has to get updated in tables. but it is not getting updated. What is the reason.
What is db2 bind process?
What is package in db2 mainframe?
What is alias in db2?
What is host variable?