An error occurred excecuting SQL statement – Root Cause?

Problem:

When we are trying to access Application, Screen, View we receive an error.

“An error has occurred executing a Sql statement. Please continue or ask your systems administrator to check your application configuration if the problem persists.(SBL-DBC-00105)”

Reason:

This error only comes when there is something wrong in the configuration. Some of the reasons can be

  • BC containing reference to invalid or non existing column name.
  • BC containing a Field without a column.
  • Wrong configuration of a join in BC.
  • Runtime events are referring to wrong fields in condition section.
  • Data Validation manager rules are referring to deleted or inactive fields.

There could be other reasons also but they all point in one direction that your configuration is not right and the resulting SQL statement from that configuration is producing an error on database

Solution:

Following steps can help you to isolate and rectify the problem.

  • Start your dedicated client after enabling the spool.
    This post contains details of how you can do that.
  • Navigate to that view, screen or applet where you face that problem.
  • Close the Client after you see the error.
  • Open the spool file that was created.
  • Scroll down to the end of the file and start reading upward from there.

You will see various SQL statements, you need to identify the statement that has error associated with it.

Copy that SQL and open Toad or SQL Developer if it is server database.
Open dbisqlc.exe if it is local env.
Run that SQL statement you just copied and you should be able to identify the problem.

In most cases it is reference to invalid column in a join or select statement.

Hope this helps.

This Post has been viewed : 34,602 Times


5 Responses to An error occurred excecuting SQL statement – Root Cause?

  1. This error also occurs when any of the below mentioned tasks are carried out:

    1.when a database copy is done from one environment to another and srf from the source is not copied on to the destination and not in synch.

    2.After code migration is carried out and resulting in extension columns not being recognized.

    3.Can also occure after a Db restore resulting in duplicate tables in the Db.

  2. This error also occurs when any of the below mentioned tasks are carried out:

    1.when a database copy is done from one environment to another and srf from the source is not copied on to the destination and not in synch.

    2.After code migration is carried out and resulting in extension columns not being recognized.

    3.Can also occure after a Db restore resulting in duplicate tables in the Db.

  3. This can also happen if your data is inconsistent.For example I had gotten this error when I tried to do a copy record on one of the employee records. One of the Columns(data type= Char(1)) had value as 'N[][][]', when obviously it should be 'N' or 'Y'.
    Make sure you also check your data if yo happen to get this error.

    -G

  4. As a side note, if you are testing on a local client and you have made changes to the database, make sure that you apply the changes to the correct db that your debugger runs on.

Leave a Reply

Contribute