You are here

function units_mathematical_expression_recreate_stored_function in Units of Measurement 7.2

Initialize a particular stored function.

Parameters

bool $create: Whether to create (TRUE) or to delete (FALSE) the stored function

string $name: Name of the stored function

string $definition: SQL definition of the stored function

array $definition_args: Any parameters that accompany $definition SQL query

1 call to units_mathematical_expression_recreate_stored_function()
units_mathematical_expression_recreate_stored_functions in ./units.module
Initialize DB stored functions necessary for the module.

File

./units.module, line 1094
Provide API for managing and converting units of measurement.

Code

function units_mathematical_expression_recreate_stored_function($create, $name, $definition, $definition_args = array()) {
  db_query("DROP FUNCTION IF EXISTS `{$name}`");
  if ($create) {
    db_query($definition, $definition_args);
  }
}