Calling Stored Procedure from client-side code

The client side Ajax call will not call your stored procedure automatically. You need to write an API action on the server side to get the data (e.g. you use { CommandType: ‘StoredProcedure’, CommandText: ‘writelog_bare’ }) and build your SQL to execute the stored procedure and then return the result. To write the server side API action, you may refer to example 4 under “Ajax by API and Client Scripts”. To execute a stored procedure you can call, e.g.

ExecuteUpdate(“CALL writelog_bare()”); // Assume MySQL and the stored procedure does not return values

If the stored procedure returns record(s) or values, you may use ExecuteRow() or ExecuteRows() or ExecuteScalar(), see the topic Server Events and Client Scripts → Some Global Functions for more information.

(https://discourse.hkvstore.com/t/how-to-call-stored-procedure-v2020/1221/1 is for v2020, if you use v2021, it is out-dated.)