ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

ODBC connection (Jdbc?) stored procedure and the returned output

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ODBC connection (Jdbc?) stored procedure and the returned output

    This is a long one, and I apologize for that. The root question is this: when I use INavigator, my program is returning a degree sign and the letter R (Output Parameter #9 = °R )

    I'm calling a stored procedure that then runs some other procedures and returns back an error message (or "success") in a 50-character field. Because it is almost impossible to test (from what I can tell) I created an RPGLE program that runs the last procedure (the one that returns the message) and ran that in debug. It looks fine. The field "result" has the correct error message in it.

    My stored procedure is defined like this:
    PHP Code:
      CREATE OR REPLACE PROCEDURE &LIB/TWINMOVPR (IN INENV   CHAR (01),          
                                     
    IN INPLT CHAR(02),                          
                                     
    IN INAPPID CHAR (10),                       
                                     
    IN INAUTH1 CHAR (10),                       
                                     
    IN INFRMLOC CHAR(06),                       
                                     
    IN INTOLOC  CHAR(06),                       
                                     
    IN INPART   CHAR(15),                       
                                     
    IN INQTY    NUMERIC(7),                     
                                     
    OUT result    CHAR (50))                    


      
    LANGUAGE RPGLE SPECIFIC &LIB/TWINMOVPR  NOT                                
      DETERMINISTIC MODIFIES SQL DATA                                            
      CALLED ON NULL                                                             
      INPUT EXTERNAL NAME 
    &LIB/TWINMOVR                                          
      PARAMETER STYLE GENERAL 


    TWINMOVR takes the APPID and AUTH1 and swaps the ID from a generic ID that is doing the connection to an actual user ID. It then sets a library list and checks to see if the user we swapped to has the proper authority to change the data.

    Then, it does this
    result = (MOVINV01 (inplant : inappid :infrmloc : intoloc : inpart : inqty : result);

    "result" should be some kind of message telling me that MOVEINV01 worked or it didn't work.

    Can anyone please help me understand why iNavigator is showing °R ?

    If I force "result" to have a value, iNavigator does show it, and I know that after the MOVINV01 procedure, "result" has a value (when I run it in my test program).

    Any help will be greatly appreciated.



  • #2
    In TWINMOVR, is result definitely defined in there as char(50)? You can sometimes see an effect like this when one side has char and the other varchar.

    Comment


    • #3
      Vectorspace, yes. I just double-checked. It is defined as char(50), not varchar.

      Here's what is probably a dumb question: I don't really understand binding directories and modules. MOVEINV01 is actually a module. Could it be that I need to remove and re-add that to the binding directory? OR, same kind of dumb question: after I do all of this, do I need to rebuild the PROCEDURE?

      I apologize for piling on the questions - no matter how many documents I read, I still just haven't grasped how stored procedures, modules, and binding directories work together and what order I have to do things in!


      Comment

      Working...
      X