*** SOLVED ***SEE BELOWI am trying to call a fairly simple SQL store procedure using a REST API. I have tested the procedure using Run SQL Scripts and it works without any issues. A new row gets added to my table when I call the procedure.
call web18.shield_addquote('email info', 'quote detail', 'someemail@gmail.com')
When I setup the REST API as a POST, the IBM i web interface recognizes the procedure and automatically adds the 3 parameters I need. I am making sure that when I call the API using Postman that the names of the parameters match exactly what the IBM i provided me. Even after making sure everything matches I get the following error stating that the parameters don't match. I have also checked and made sure the permissions were correct for the proc and the table.
{ "SQLStateInfo": { "rowsAffectedCounts": null, "SQLError": { "SQLState": "42884", "SQLCode": -440, "message": "[SQL0440] Routine SHIELD_ADDQUOTE in WEB18 not found with specified parameters." }, "SQLWarnings": null } }
** UPDATE **
So I thought I would approach the problem a different way. I put just a simple insert on the API call and then I created a trigger that would perform the rest of the functionality (send an email). I tested and again adding data to the table from outside the API works and the trigger fires. When I perform the same using the API I get the following:
{ "SQLStateInfo": { "rowsAffectedCounts": null, "SQLError": { "SQLState": "09000", "SQLCode": -723, "message": "[SQL0723] SQL trigger SHIELD_NEW_QUOTE in WEB18 failed with SQLCODE -443 SQLSTATE 38501." }, "SQLWarnings": null } }------------------------------
Jeremy Bowling
------------------------------