public void CreateProcedure3() { var command = @"Create PROCEDURE GetCategoryName AS Select CategoryName From Categories Where CategoryID = [@categoryID]"; var db = new ProcedureDatabase(); db.ExecuteCommand(command); }
public void CreateProcedure1() { var sb = new StringBuilder(); sb.AppendLine("DROP PROCEDURE IF EXISTS ADD_CATEGORY;"); sb.AppendLine("CREATE PROCEDURE ADD_CATEGORY(IN CATEGORY_NAME VARCHAR(30), IN CATEGORY_DESCRIPTION TEXT)"); sb.AppendLine("BEGIN"); sb.AppendLine("INSERT INTO CATEGORIES (CategoryName, Description)"); sb.AppendLine("Values (category_name, category_description);"); sb.AppendLine("END;"); sb.AppendLine(); var db = new ProcedureDatabase(); db.ExecuteCommand(sb.ToString()); }