Results 1 to 2 of 2

Thread: getting returncode from a stored procedure

  1. #1
    Join Date
    Apr 2009
    Posts
    22

    Default getting returncode from a stored procedure

    Hi,

    I have a sybase stored procedure which returns a value at the end of the stored proc "RETURN 0"

    I created a java class which extends StoredProcedure class and have the following
    declareParameter(new SqlOutParameter(RETURN_CODE, Types.INTEGER));

    The stored procedure does'nt return any values using the traditional OUTPUT mechanism.

    When I execute the class, the stored proc gets invoked, but I get this error " JZ0SG: A CallableStatement did not return as many output parameters as the application had registered for it"

    I replaced RETURN_CODE constant with various values such as "RETURN", "return", "RETURN_CODE", but no luck.

    Is there anyway I can get the return code of a stored proc ?

    Thanks.

  2. #2
    Join Date
    Apr 2009
    Posts
    22

    Default getting returncode from a stored procedure

    ok, looks like all it needed was the below line
    setFunction(true);

    It now works and returns the required value. I hope there are no other side affects of using the above call.

Posting Permissions

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