Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Accounting Stored Procedure Example

 

A simple stored procedure can return a result set in the same way as a Select statement. For example, assume you have a table with the following fields: username, password, Alias, and active, where all fields have the datatype varchar. You want a stored procedure that will return a password and alias when the username and password received in the request match entries in the database, provided that active field has a value of Yes.

The following example executes a stored procedure to update an accounting table in Steel-Belted Radius Carrier.

  1. Create an accounting table by executing the following command:

  2. Create an rsp_account stored procedure that can be called by a *.acc file.

  3. Create the mysqlacct.acc file to call the rsp_account stored procedure.

    The mysqlacct.acc file uses an SQL=EXECUTE procedure_name value1,...valueN statement instead of an SQL=INSERT into table (column1, ...columnN) Values (value1,...valueN), because the stored procedure performs the INSERT action.

    Be sure to configure the CONNECT statement to reflect your operating environment.