Important
Self-managed SingleStore will soon transition from version 9.1 RC to version 10. This new semantic versioning scheme will provide SingleStore with finer control over engine and feature releases that were not possible with the current versioning scheme.
In the interim, SingleStore 9.1 RC can be used to preview, evaluate, and provide feedback on the new and upcoming features in SingleStore 10 prior to its general availability. Ahead of this transition, SingleStore 9.0 is recommended for production workloads, which can later be upgraded to SingleStore 10.
SingleStore Studio SQL Editor
On this page
Important
Studio is designed to work with MemSQL 6.
The SQL Editor page is a feature of Studio that allows customers to edit and run SQL queries against their SingleStore clusters.
The editor in this page works like a worksheet where users can type in multiple SQL queries and then choose which queries they want to run.
Creating and Running a Stored Procedure
In order to create a Stored Procedure in the SQL Editor, simply paste a regular CREATE PROCEDURE block into the editor:
DELIMITER //CREATE PROCEDURE charge_account(id BIGINT, amount DECIMAL(18,4)) ASDECLAREbalance_tbl QUERY(bal DECIMAL(18,4)) =SELECT remaining_balanceFROM account_balanceWHERE account_id = id;balance DECIMAL(18,4) = SCALAR(balance_tbl);updated_balance DECIMAL(18,4) = balance - amount;BEGINIF balance > amount THENUPDATE account_balanceSET remaining_balance = updated_balanceWHERE account_id = id;END IF;END //DELIMITER ;
Then, you can either select and execute the entire block or simply place the editor cursor anywhere in between the // delimiters and click Run.
Finally, running the stored procedure works like running any query.CALL charge_ into the SQL Editor and click Run.
Last modified: