Written by Andrew Wilson
John Hugg was talking with me today about a way to reduce the complexity of error checking in a stored procedure and how rarely it is used. VoltDB’s stored procedures let you set “expectations” on each SQL statement. Those expectations can eliminate several lines of code leading to shorter, readable and more reliable stored procedures.
Consider the following sample:
CREATE TABLE user_table (
user_name varchar(200) UNIQUE NOT NULL,
password varchar(100) NOT NULL,
CONSTRAINT user_name_idx PRIMARY KEY