Before falling ill I was working on a really strange problem and I was able to get the solution of it. So, today I am going to share the problem and solution of the problem.
Problem:
After applying some patch on database suddenly we started receiving error on Accounts Screen. On clicking Account List View we received the following error
Error retrieving next record from the database.(SBL-DBC-00104)
The Research:
I did what we usually do to debug these issues. Enabled the logs and logged in through dedicated client and spooled the logs.
What I found out was that a query was being fired in backend that had a extra condition and again Sort Search Optimization was responsible for it but what was strange was, that query was trying to query on a special character which looked like a square. Here is what the query condition looked like
((T14.INT_ORG_FLG != ‘Y’ OR T14.PRTNR_FLG = ‘Y’) AND
(T4.ACCNT_NAME >= :2))
ORDER BY
T4.POSITION_ID, T4.ACCNT_NAME
Bind variable 1: 1-6ILGF
Bind variable 2:
[I am sorry but I am not able to produce the square symbol here. Please assume that It is there
]
I tried various ways to suppress this condition including the use Sort Search Optimization user property but the error persisted.
More analysis into logs divulged another error.
ORA-24345: A Truncation or null fetch error occurred
Reason:
Searching on support web revealed that this error occurs usually if there is a difference between the BC Field type and physical type. For example
If I create Field of Type DTYPE_BOOL and map it to a column of type VARCHAR with length greater than 1 this error can occur if there is a record in a database that has data in that column which is greater than 1 char.
Solution:
What I found out was really an anti climax and I stumbled upon the answer by accident. The reason was that due a requirement somebody had changed a length of a column in Account BC from 50 to 4 and column underlying had data more than 4 characters resulting in this error.
How I found it out was that accidently I compiled an old version of Account BC after making some changes and problem was solved. Afterwards comparing the new and old version reveled that this column length had been changed.

(2 votes, average: 4.5 out of 5)
5 Comments at "Truncation or null fetch error occurred"
Good post!!! but regarding square, i don’t think if it is real problem
Yes, you are right test… square was not real problem… but it was a part of problem. A different problem though… it resulted in performance issues
that is to show that when you work with Siebel you should be very carefull of what you touch, that error and the generick not ok error are very misleading to solve and usually end up beign simple comfigurations errors.
The “square” is a special character used internally by Siebel for performance issues. This dates back to a time when we did not have Cost-based optimization supported by Siebel, and the engine tried to “push” for certain indexes/optimization paths for faster query output. 7.8 and onwards, Siebel has moved out of this feature, but sometimes, for certain entities, you do stumble across the speciail character in a query.
This is a good post. I also encountered this issue in Production where when navigating to a particular view, users were getting “ORA-”24345: A Truncation or null fetch error occurred” error message. Later our investigation we found out there was a joined field on one of the applet of the view that had a type of DTYPE_NUMBER, however it was mapped to a columns of type Text of joined table. The solution was to correct the type of BC field. The good practise is that when you create a joined field, Siebel automatically updates the field type and developer should stick with that.
Comment Now!