Help for StoredProcedureCall.call() method

Posts   
 
    
Posts: 1
Joined: 08-Dec-2020
# Posted on: 08-Dec-2020 11:58:18   

Hello, I am using your registered version 5.5 and have downloaded latest trial version 5.7. I am adding some error handling to the existing code which was written by somebody else. Here the person was not checking for any return value for the functions. So my task is to check for the retun values correctly so as to avoid any crashes and exceptions during DB operations. I am using the StoredProcedureCall.call() method to call my Stored procedure. As per the documentation it returns Int32 value but its not mentioned anywhere what is this value? 1.Is this no. of rows affected? 2.Is this the return value of the SP? 3.Is this the status of the call() function? If yes what are the possible values of it? 4.Is the value gives any success or failure status? I am getting values as -1, 1 in my case so not sure how can I check if the SP has run correctly. Can you please help me on this.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 08-Dec-2020 14:54:43   

the value returned is the value returned by DbCommand.ExecuteNonQuery. In general this is the value returned by the procedure on e.g. sql server, but it depends on the database type.

Calling a stored procedure should be done basically by adding a mapping to the procedure in the designer, generate code and then call the method. Manually constructing the StoredProcedureCall object is a possibility of course, but the code generator can do that for you.

Frans Bouma | Lead developer LLBLGen Pro