You are here

public function FrxMSSQL::data in Forena Reports 7.2

Same name and namespace in other branches
  1. 6.2 plugins/FrxMSSQL.inc \FrxMSSQL::data()
  2. 6 plugins/FrxMSSQL.inc \FrxMSSQL::data()
  3. 7 plugins/FrxMSSQL.inc \FrxMSSQL::data()

Get data based on file data block in the repository.

Parameters

String $block_name:

Array $parm_data:

Query $subQuery:

File

plugins/FrxMSSQL.inc, line 64
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 data($block_name, $params = array(), $clause = '') {

  // Load the block from the file
  $db = $this->db;
  $block = $this
    ->load_block($block_name);
  $xml = '';
  if ($block['source'] && $this
    ->access($block['access']) && $db) {
    $sql = $block['source'];
    if ($clause) {
      $sql = 'SELECT * FROM (' . trim($sql, ' ;') . ') ' . $clause;
    }
    $sql = $this->te
      ->replace($sql);
    if ($this->use_mssql_xml) {
      $xml = $this
        ->mssql_xml($sql, $block_name);
    }
    else {
      $xml = $this
        ->php_xml($sql);
    }
    if ($this->debug) {
      if ($xml) {
        $d = htmlspecialchars($xml
          ->asXML());
      }
      FrxReportGenerator::instance()
        ->debug('SQL: ' . $sql, '<pre> SQL:' . $sql . "\n XML: " . $d . "\n</pre>");
    }
    return $xml;
  }
}