Results 1 to 4 of 4
  1. #1
    Join Date
    May 2012
    Location
    Canada
    Posts
    14

    Question Unanswered: Error Code: -313 occured on J2EE Application

    [30/05/12 9:31:58:789 PDT] 00000021 SystemErr R classes.SQLExceptionAdapter: A database error was encountered. Error Code: -313

    I am trying to download the sql to a excel sheet. But the sql statement that i am executing to get the desired results is returning the above error.

    Here's a more detail about the query that is expected to work.

    [30/05/12 9:26:50:914 PDT] 00000021 SystemErr R SQLException -313: The number of host variables in the EXECUTE or OPEN statement is not equal to the number of values required.
    [30/05/12 9:26:50:929 PDT] 00000021 SystemErr R Statement: Select ActualHrsID, RunMonth, RunYear, ClarityID, ProjectName, ResourceName, ResourceID, ResSupplyL2, ResSupplyL3, ResSupplyL4, ResSupplyL5, ResSupplyL6, ResSupplyL7, ResSupplyL8, ResSupplyL9, ResSupplyL10, StaffObsValue, TimeSheetStartDate, TimeSheetStartDate, TimePeriodID, HoursType, PostedTime, UnitsConsumed, Posted, LoadUser, LoadDate, ResourceBillable, ETC, SiteteamID, ProjectTeamID, RateName, HCD, HCMAmount, USDAmount from ActualHrs_Staging ahs WHERE ahs.CLARITYID Like [?]
    [30/05/12 9:26:50:929 PDT] 00000021 SystemErr R Parameters:[]

    Can someone please help me solve this problem. Let me know if any further information is needed

    Thanks,
    jassi

  2. #2
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    Always post your DB2-server version + fixpack and Operating-system name for each new post.

    Did you write this application yourself, or do you have the source-code?

    The error is happening because the query neeeds an argument (a parameter), and the application did not provide that argument (i.e. the DB2 server did not get a required argument). At least, that is what the -313 error means.

  3. #3
    Join Date
    May 2012
    Location
    Canada
    Posts
    14
    IBM DB2 Database for Linux, UNIX, and Windows Version 9.

    Yes i wrote this by myself. I do have source code

    The application is passing the parameter i.e params : [%00419/%]
    the above value i founded by debugging the application.

    Don't know where it is going wrong.

  4. #4
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    The parameter is not reaching the DB2 server.
    In your query that you prepare (which includes the parameter marker) have you put single quotes around the parameter marker?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •