5.2. Declaring the Stored Procedures

Documentation

Home » Documentation » Using VoltDB

5.2. Declaring the Stored Procedures

In addition to compiling the stored procedures, you must tell VoltDB which procedures to include in the runtime catalog. You do this by adding CREATE PROCEDURE statements to the database schema. For example:

CREATE PROCEDURE FROM CLASS procedures.LookupFlight;
CREATE PROCEDURE FROM CLASS procedures.HowManySeats;
CREATE PROCEDURE FROM CLASS procedures.MakeReservation;
CREATE PROCEDURE FROM CLASS procedures.CancelReservation;
CREATE PROCEDURE FROM CLASS procedures.RemoveFlight;

Be sure to identify all of your stored procedures or they will not be included in the catalog and therefore will not be available to the client applications at runtime.

You also specify the partitioning of the database tables and stored procedures in the schema. The important point is that if you do not specify partitioning information for a table, that table will be replicated in all partitions. See Section 3.1, “Designing the Database” for more information about partitioned and replicated tables.