Truncation or null fetch error occurred

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.

This Post has been viewed : 18,810 Times


14 Responses to Truncation or null fetch error occurred

  1. 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 🙂

  2. 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 🙂

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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.

  9.  Hi People, I am facing a similar problem, please guide me through this:
    I have to Increase the size of an extension column say
    X_Connection_Id in base table S_ASSET.
    from varchar(20) to varchar
    (30).

    Here are the steps I performed for same:
    1) Change the column
    size in Tools under table S_ASSET.
    2) Apply the changes to database by
    clicking on Apply/Generate DDL button.
    3) Click on Activate button.
    4) Go
    to BC which uses this column, and reselect column so that updated size is
    reflected in fields as well.
    5) Compile the BC again.
    6) Compile the
    Applet again, which is using the re sized column.

    Now the problem is that
    when I insert a value more than 20 chars from database, and then query that
    particular record on application I get the following error:

    [1] An error
    has occurred a Sql statement.
    Please continue or Ask your system
    administrator to check your application configuration if the problem persists
    (SBL – DBC – 00105)
    [2] ORA – 24345: A Truncation or null fetch error
    occurred.

    Please help me ASAP, I am stuck in this issue for 3 days
    now.

    • I think you need to alter this column at the database level. Once that is done you should be able to solve this problem.

  10. Hi, I am facing the same problem in production. There is contact record. I am not able to update any field. I am trying to update email id and saving it. It is giving the above error. I can update email for other contacts but not to this.

    Any idea? why is this only for one contact in production?

    Thanks.

Leave a Reply

Contribute