The last step in adding stored procedures is to declare the procedures in the database schema. You declare the stored procedures by adding CREATE PROCEDURE statements to the database schema, helloworld.sql. Add two CREATE PROCEDURE statements, one for each procedure specifying the class name, like so:
CREATE PROCEDURE FROM CLASS Insert; CREATE PROCEDURE FROM CLASS Select;
In VoltDB you partition both the data and the processing (that is, the stored procedures) that access the data. Both stored procedures access the HELLOWORLD table using the partitioning column, Dialect, in the selection criteria. Therefore we can partition both procedures on the HELLOWORLD table. To do that, we add PARTITION PROCEDURE statements to the schema, similar to the PARTITION TABLE statements we added earlier for the data:
PARTITION PROCEDURE Insert ON TABLE Helloworld COLUMN Dialect; PARTITION PROCEDURE Select ON TABLE Helloworld COLUMN Dialect;
The definition and declaration of our stored procedures is now complete.