function tripal_core_is_sql_prepared

1.x tripal_core_chado.api.inc tripal_core_is_sql_prepared($statement_name)

Indicates if the SQL statement is prepapred

Parameters

$statement_name: The name of the statement to check if it is prepared.

Return value

TRUE if the statement is preapred, FALSE otherwise

9 calls to tripal_core_is_sql_prepared()
tripal_core_chado_delete in tripal_core/api/tripal_core_chado.api.inc
Provides a generic function for deleting a record(s) from any chado table
tripal_core_chado_execute_prepared in tripal_core/api/tripal_core_chado.api.inc
Execute a prepared statement with the supplied values
tripal_core_chado_prepare in tripal_core/api/tripal_core_chado.api.inc
Prepare a chado query
tripal_core_chado_update in tripal_core/api/tripal_core_chado.api.inc
Provides a generic routine for updating into any Chado table
tripal_cv_add_cvterm in tripal_cv/api/tripal_cv.api.inc
Add's a CV term to the cvterm table. If the parent CV does not exist then that too is added to the CV table. If the cvterm is a relationship term then the $is_relationship argument should be set. The function will try to first find theā€¦

... See full list

File

tripal_core/api/tripal_core_chado.api.inc, line 3001
The Tripal Core API

Code

function tripal_core_is_sql_prepared($statement_name) {
  global $prepared_statements;

  if (!is_array($prepared_statements)) {
    watchdog('tripal_core', "tripal_core_is_sql_prepared: argument must be an array", array(), WATCHDOG_ERROR);
    return FALSE;
  }

  // check to see if the statement is prepared already
  if (in_array($statement_name, $prepared_statements)) {
    return TRUE;
  }

  // @coder-ignore: acting on postgres tables rather then drupal schema therefore, table prefixing does not apply
  $sql = "SELECT name FROM pg_prepared_statements WHERE name = '%s'";
  // do not use 'chado_query' here or it causes memory-leaks
  $result = db_fetch_object(db_query($sql, $statement_name));

  if ($result) {
    return TRUE;
  }
  return FALSE;
}