You are here

public function FrxMSSQL::searchTableColumns in Forena Reports 7.4

Perform search of tables.

Overrides FrxDataSource::searchTableColumns

See also

FrxDataSource::searchTables()

File

plugins/FrxMSSQL.inc, line 165
Oracle specific driver that takes advantage of oracles native XML support

Class

FrxMSSQL
@file Oracle specific driver that takes advantage of oracles native XML support

Code

public function searchTableColumns($table, $str) {
  $str .= '%';
  $db = $this->db;
  $sql = $this
    ->searchTableColumnsSQL();
  $str = "'" . str_replace("'", "''", $str) . "'";
  $sql = str_replace(':str', $str, $sql);
  $table = "'" . str_replace("'", "''", $table) . "'";
  $sql = str_replace(':table', $table, $sql);
  $rownum = 0;
  $rs = mssql_query($sql, $db);
  $columns = array();
  if ($rs) {
    while ($row = mssql_fetch_assoc($rs)) {
      $columns[] = $row['COLUMN_NAME'];
    }
  }
  if ($rs) {
    mssql_free_result($rs);
  }
  return $columns;
}