#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2008
    Posts
    3
    Rep Power
    0

    Question FBSQLException 335544358 message length error (encountered 0, expected 8)


    Hi,
    I am trying to execute stored procedure.
    When I do it from SQL command line, data gets inserted just fine. I do select *. The data is there, everything looks good.
    If I am trying to execute the same stored procedure from within Java code (below are parts of it):
    PreparedStatement stm = null;
    ResultSet r;
    r = stm.executeQuery();
    I get this error:
    FBSQLException 335544358 message length error (encountered 0, expected 8)
    I am able to execute another stored procedure using the same Java code. String "Execute Procedure..." looks exactly the same in Java and in SQL command line. Have you ever seen above error? What could be causing it?
    Thank you in advance.
  2. #2
  3. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    539
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2008
    Posts
    3
    Rep Power
    0

    code


    I posted a small part of it. Let me know if you need much more info. It works fine for other stored procedure.
    Do you want more info?
    Thanks.
  6. #4
  7. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    539
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2008
    Posts
    3
    Rep Power
    0

    Fixed it.


    I fixed it. It turned out to be known firebird bug. I used "select * from PROC_NAME..." instead of "execute PROC_NAME..." and it worked.
    Thank you for looking into this anyway.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2006
    Location
    Plovdiv. Bulgaria
    Posts
    226
    Rep Power
    13
    I want to share my experience with this error, I encounter just yesterday. In my case the stored procedure was called with EXECUTE PROCEDURE inside another SP. There wasn't any SUSPEND in the called procedure, that is why I called it with EXECUTE statement.
    In my case - the application that used the procedures as first step did a convert to some stored procedures in the database before using them.
    As a result I've got the error message length error (encountered xxx, expected yyy).
    How I fixed - the Firebird server was Classic server. I had to close all connections to the database and after that to reconnect with my app again( this time without doing the changes - they were already made) and then the application saw the "new"/last/actual versions of the changed procedures and everything was fine after that.
    Until now 99% of the time I work with Superserver version of Firebird and that is why I didn't know for that behaviour of the server.
    So maybe this is another reason for that error. I didn't find another case like mine, so I hope that this post will help someday somebody not to
    Last edited by mIRCata; December 2nd, 2012 at 11:25 AM.

IMN logo majestic logo threadwatch logo seochat tools logo