How to find out the column causing the error while doing update or insert

I'm getting the below error when attempt to update or insert a long string that is more than its defined length in the DB2. For example in table the column length is defined as 50, however from UI the data for that column is more than 50 chars.
{color:#ff0000}**Caused by: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -302, SQLSTAT**
**E: 22001, SQLERRMC: null**
**at com.ibm.db2.jcc.b.hh.b(hh.java:1369)**
**at com.ibm.db2.jcc.b.hh.c(hh.java:1356)**{color}
The above issue can be fixed by setting maxlength in the UI itself. However in my case, there is a backend program trying to insert or update load of records. If the exact column name causing the error is known, it will be helpful to load the data properly in the next attempt.
I have worked around it using SQLWarning and DataTruncation, but couldn't find the solution yet.
Any help on this issue will be really appreciated.

Medraf wrote:
what is validator? Is it like validation.xml in struts? Are you suggesting like defining set of validation rules in the xml and apply the same for each record before doing any update or insert in DB? If so, then I could implement this validation logic in my backend code, however it may take more time to complete the batch prcoess.
How you implement doesn't matter.
However given a schema generating code for such validation is trivially simple at least for field types and sizes. Relationships are harder but those can be handled via custom rules.
Alternatively I'm looking for some kind of API in JDBC or Hibernate which gives the detailed sql exception message containing the error info like the column name and the reason for failure while update or insert. If not possible, then validation logic needs to be implemented.Having seen something similar in Oracle years ago I seriously doubt that you are going find it magically appearing in JDBC/hibernate. There might be warning on the SQLException (see the java docs for SQLException) but I wouldn't count on it. Other than that the only possibility is making some sort of call in db2 itself that tells you the error. Only problem with that is it might require the context which might not be available once you see the error (presuming, especially for performance, that you are using batch processing.)
As a start figure out how to find out using only db2 (docs and/or db2 forums.)

Similar Messages

  • How to find out what is causing an error in a BPM process

    I have a very basic question and I can't figure it out from help.sap.com
    I have a BPM process deployed to a SAP NW Java BPM 7.40 system. It can be triggered with a web service call.
    It goes into error immediately. I go to NW Administrator > Operations > Process and Tasks > Manage Processes and see the process with status  "Error". But the "Error log" tab below is grayed out. I can't see any error message anywhere.
    How do I find out what is wrong?

    Ah, I didn't notice that on the history tab I can switch from Basic to Medium or Advanced, in Basic it was showing nothing. In Medium and Advanced it shows:
    Mapping failed
    com.sap.engine.services.jndi.persistent.exceptions720.NameNotFoundException: Object not found in lookup of test.sap.com.polreuse.ejbs.UUIDProviderLocal.
    java.lang.IllegalArgumentException: Could not lookup 'test.sap.com/bpmear/LOCAL/UUIDProvider/test.sap.com.polreuse.ejbs.UUIDProviderLocal' bean
    com.sap.mapping.lib.execution.api.exception.TExecutionException
    at EJB::test.sap.com/bpmear/LOCAL/UUIDProvider/test.sap.com.polreuse.ejbs.UUIDProviderLocal( StandardInvocation:invoker )
    at ( DeepExpression )
    at UUID( TerminalPart:expression )
    at result( BroadPart:child )
    at ( NarrowMapping )
    at com.sap.mapping.lib.execution.implementation.Compiler$StandardMappingFunction@241ade69( StandardInvocation:invoker )
    at ( DeepExpression )
    at MessageHeader( TerminalPart:expression )
    at http://sap.com/xi/SAPGlobal20/Global:NewLBrdngFSCreateRequest( BroadPart:child )
    at ( NarrowMapping )
    What could this mean? I didn't deploy all parts correctly or something like that?
    Also, where do I check the default trace?

  • How to find out which type of the driver is used in our application?

    Hi all,
    can anyone tell me how to find out which type of the driver is used in our application?
    Thanks in advance,
    Phoeniox

    Hi,
    Check out this...
    Class.forName("com.mysql.jdbc.Driver"); //if u r using MySql
    List drivers = Collections.list(DriverManager.getDrivers());
                   for(int i=0;i<drivers.size();i++)
                        Driver driver = (Driver)drivers.get(i);
                        String driverName = driver.getClass().getName();
                        System.out.println("Driver "+i+":::"+driverName);
    you need to load the driver and display in the same program.
    Then only you'l get the required result.
    prakhyath

  • How to find out who has deleted the production Query

    Hi All,
    I have searche SD , i can find it for infoobject deletion but i couldn't find it for Query.
    Please let me know is there any possiblity to kow
        How to find out who has deleted the production Query
    Awaiting for your replies.
    cheers

    Hi Mahesh and all,
    Thanks for all your  inputs.
    I have tried with RSRREPDIR tabel , I am unable to see that query at all.
    If I use theT-code SLG1,
      please guide me on the steps with paramets to be given in the respective ..object, subobject etc..
    OR
    could you please suggest any other way.
    cheers
    leena

  • How to find out who had deleted the function moldule? S O S

    how to find out who had deleted the function moldule Thank you very much.

    if this fm was assigned to device class (package) you'll find it in
    tables tadir, e070, e071
    try with name of function module or function group
    hope that helps
    Andreas

  • How to find out what are all the change pointers assoicated for an idoc ??

    Hi ,
    How to find out what are all the change pointers activated for an idoc ??
    Thanks,
    Varma

    Verma,
    You can check what are the active Change Pointers for the message type in tcode <b>BD50</b>
    Use tcode <b>BD61</b> to check whether change pointers are active or not??
    Hope this helps..

  • How can find out LONG column database?

    Hi,
    in my database ORA-1461 error occured
    01461, 00000, "can bind a LONG value only for insert into a LONG column
    how can find out LONG column in my database ?

    DESCRIBE
    The description for tables, views, types and synonyms contains the following information:
    each column's name
    whether or not null values are allowed (NULL or NOT NULL) for each column
    datatype of columns, for example, CHAR, DATE, LONG, LONGRAW, NUMBER, RAW, ROWID, VARCHAR2 (VARCHAR), or XMLType
    precision of columns (and scale, if any, for a numeric column)
    Extract of the link;
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12019.htm#SQPUG040
    Secondly with reference to the error;
    Do not try to insert LONG datatypes into other types of columns.
    Hope this helps.
    Adith

  • How to find out which user has the permission to execute startsap ?

    Hi All
    How do I find out which user has the permission to execute the startsap and stopsap? Do I control the permission on those script using windows standard authorization? For example: only allow certain user have the read and write permission?
    Thank you.!
    Vincent Lo

    Well to me this is really weird question..
    <b>noone un-authorized should have access to OS on your system</b>
    If this is valid you do not need to solve problems who can and who cannot start/stop SAP, because if you want to prevent some users from shutting down the SAP you have really hard job to do - there are many ways how to kill the SAP (for example killing relevant process from task manager, killing of database, messing with services etc.) - yes, this is harmful way of stopping SAP, but we are talking about attack, right? I would contact some Windows specialist to help you disable all the ways how to harm the running SAP. But still after that - there are many files that can be modified/deleted so SAP will crash after restart - you need to protect them too, etc.
    In case you take the first assumption as granted (and you really limit access to this server) you do not need to worry who can stop or start SAP - at the other hand it may be handy to be able to start/stop SAP from other users - for this you can run the stop/start script "under different user".
    But to answer the question - to me this is question just of access control (but really never tried that myself):
    <a href="http://technet2.microsoft.com/WindowsServer/en/library/c6413717-511e-42bd-bd81-82431afe4b2a1033.mspx">Permit or restrict access to a snap-in for a domain</a> (or see other related links down there on this page)
    Please award points for useful answers.
    Thanks

  • System log - how to find out who has deleted the req from cube.

    ^hello friends
    how can i find out who has deleted the request from cube ?
    i wanted to check the system log , that who has deleted the request from cube .
    could you please let me know how to check the same ?
    regards
    manoj

    Hi,
    Did you try the method I had suggested. It will work.
    Also its better to try the path I had suggested as it will display the logs for that particular Cube only.
    But if go through SM37 > B_DEL* it will display all the logs for all the deletion jobs not just this cube and it will be difficult to find out.
    Try that and you should get the log.
    Thanks,
    JituK

  • How to find out table name for the field in the webUI

    Hi.
    I am in CRM2007.
    So i go to the transaction code    BSP_WD_CMPWB
    In that i provide the component name as CRM_UI_FRAME.
    I press the Test button.
    So, it opend the WebUI.
    I want how to find out table of the particular input field?
    I mean from which table the data is retrived how to find out?
    When i enter some thing in the input field how to find out in which table that data is stored?
    By pressing F2 on the input field it opend View and Component Name.
    I want find out table of that particular field. How to find it?
    If anybody know about this explain it with Screen shorts if possible.
    Thank You.
    Krishna. B.

    hi
    goto tx genil_model_browser. Suppose you want to find fields reated to your order header eg sold to name. In component set write all and press F8. Then goto access object and in access object click on node BTAdminH. Click on attribute structure. Here you will find structure and attributes. If you click relationship then you will see all the relationship wrt btadminh. open any r/s that you require. and click on other object and attribute. You will get to know the structure.
    Best regards
    Pankaj kumar

  • How to find out who has released the purchase order?

    Hi All,
    I have a PR number lets say 10231322 and somebody has release it. Could any one please tell me how to find out who has release it?
    Waiting for your kind replies......
    Thanks in advance.
    Regards,
    Faisal

    Hi,
    When you are in tr ME23N, use the menu: environment > header changes.
    Rgds,
    Suzy

  • How to find out program name to the corresponding output type of invoice..

    hi ALL,
    I want to findout program name to my output type.
    For one invoice functional peoples are configured. Here i know the outtype. But i don't know the program name .
    Can any body please tell me how to find out the program name for the output type..?

    Hi,
    Goto NACE t-code
    Select Billing (V3)
    Press 'Output Types' Button
    In the next screen select the corresponding output type you want.
    Then press 'Processing Routines' in the left pane. You can see the program name
    Cheers,
    Kothand

  • How to find out Particular column value in DB

    Hi All,
    I have to find out Particular column value in DB .can U tell me the Query for that.

    There is one way:
    Re: How to write the Query

  • How to find out which usb is the fastest

    How can you find out which usa port is the fastest, using a mypassport for my  backup photos??

    It's called a USB (Universal Serial Bus).
    All the USB ports operate within a given speed range. You have USB2.0 on your iMac. All your USB2 ports operate at the same speed up to 480MB/sec. Realistically you'll only see ~300MB/Sec.
    Pick a port and use your backup drive.

  • How to find out which one of the few devices connected to the account made a purchase through ITunes?

    How can I find out which of the devices assosiated to my account made a purchase?

    the only reliable way to do this is by scanning table TBTCP using the person's userID in field AUTHCKNAM and filtering by job statuses: scheduled, released, ready and active (sorry I can't remember the code#'s off top of my head, something like P=scheduled, S=scheduled...you have to look it up).   When you search SM37 it only permits you to scan by the userID who created the job, but it won't tell you if a different userID is defined in a job step.  That's why you need to scan TBTCP.  Don't forget that you should also check for a user's open Workflow items before deletion.
    I noticed some posts in this forum that suggest a userID should never be deleted, only locked, added to a special user group, and all role assignments removed.  However I've never worked somewhere that does this.

Maybe you are looking for

  • Text in table comes out as bold or bolder when I email it???

    I have been very successful in writing and emailing my press releases. However... How I create then is via creating a table in Dreamweaver and putting everything there. The reason why I use a table is so that I can make sure that the content occupies

  • QuickTime I/O error #36 from Xsan

    Anyone have an idea or a pointer to a RTFM regarding quicktime i/o error #36. Happens with certain QTs when they are played from the Xsan. The same QT works fine from the desktop. The permissions are wide open, so that isn't the problem. Thanks in ad

  • Out of Bounds

    I am using Elements 9 in a quad core computer 8gig memory and everytime I try to use Out of Bounds in the Guided section my whole computer freezes after I click in Add a Frame.  Hope someone can help, thank you.

  • Pl/sql or numeric value error

    Hi I'm trying to append CLOB to CLOB (assuming both are not null and lenght is less than the max allowed) and getting the error, Why is that error coming, the length cobined is only 50k. PK_UTILITIES.sp_get_recs(site_id_i, entity_id_i, false, v_clob_

  • Exchange 2010 dynamic distribution group - too many entries in results

    Hi I've inherited some dynamic groups that were created on exchange 2003 [about 50 groups]. When I run the following query I seem to get far too many users returned [looking via ADUC the group should have 2 users]. How can I ensure I get the correct