Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 734
  • Last Modified:

Oracle Data On Insert Error: Data too large for column (is there a way a trace which column failed)

Hi guys, I have a jsp page with about about 60 data fields, which is inserted into an oracle table.  Sometimes the insert statement fails during insertion, getting error data too large for column.  Is there a way in oracle to automatically trace the colum that failed.
Please help with any infor, cheers!!!
0
mi_cky
Asked:
mi_cky
1 Solution
 
stefan73Commented:
Hi mi_cky,
Not that I know of. Can't you simply limit the jsp field sizes so that their limits match with the appripriate column sizes?

Cheers!

Stefan
0
 
stefan73Commented:
When the insert fails with "Data too large for column", it's already too late.
0
 
mi_ckyAuthor Commented:
Yes  but its a wide developement project at the moment , and issues such as limiting the field sizes to column sizes will be done towards the end of project. for now its lots of development .................
So does this means its totally impossible to trace this ............
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
paquicubaCommented:
This is what I do:

I create a JSP page named ErrorPage.jsp like the one below.

------- Starts below this line ----------------------

<?xml version = "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<%@ page isErrorPage = "true" %>
<%@ page import = "java.util.*" %>
<%@ page import = "java.sql.*" %>

<html xmlns = "http://www.w3.org/1999/xhtml">

   <head>
      <title>Error!</title>

      <style type = "text/css">
         .bigRed {
            font-size: 2em;
            color: red;
            font-weight: bold;
         }
      </style>
   </head>

   <body>
      <p class = "bigRed">

      <% // scriptlet to determine exception type
         // and output beginning of error message
         if ( exception instanceof SQLException )
      %>

            An SQLException
                  
     
      <%
              else if ( exception instanceof ClassNotFoundException )
      %>

            A ClassNotFoundException
     
      <%
         else
      %>

            An exception

      <%-- end scriptlet to insert fixed template data --%>

         <%-- continue error message output --%>
         occurred while interacting with the <YOUR DATABASE NAME> database.
      </p>

      <p class = "bigRed">
         The error message was:<br />
         <%= exception.getMessage() %>
      </p>

      <p class = "bigRed">Please try again later</p>
   </body>

</html>

--------------- ends above this line -------------------------------


Then, I include this directive in any JSP page that interacts with the database:

<%@ page errorPage = "ErrorPage.jsp" %>

The SQLException will tell me where the error occurred.

Hope this helps!
0
 
helpneedCommented:
hi

u know which query is doin this so wht u can do is
using the dbms_system.set_sql_trace_in_session(sid,serial#,true) ..(pleases check the syntax)u can trace this and find out the trace file for this and also u can use the tkprof utility to format the trace file and then find out exactly where the problem occurs

regards
0
 
absongCommented:
if you can figure out what the query looks like (through the log file), maybe you can simply run it through SQLPlus? remember to split the query into a few lines, and SQLPlus will tell you.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now