コード例 #1
0
ファイル: pgsql_engine.php プロジェクト: blakeHelm/BallotPath
 public function DoExecuteCustomSelectCommand($connection, $command)
 {
     $upLimit = $command->GetUpLimit();
     $limitCount = $command->GetLimitCount();
     if (isset($upLimit) && isset($limitCount)) {
         $sql = sprintf('SELECT * FROM (%s) a LIMIT %s OFFSET %s', $command->GetSQL(), $limitCount, $upLimit);
         $result = $this->GetConnectionFactory()->CreateDataset($connection, $sql);
         $result->Open();
         return $result;
     } else {
         return parent::DoExecuteSelectCommand($connection, $command);
     }
 }
コード例 #2
0
 private function GetFieldValueAsSQL($fieldName, $value)
 {
     $fieldType = $this->fields[$fieldName];
     return $this->commandImp->GetFieldValueAsSQL(new FieldInfo('', $fieldName, $fieldType, ''), $value);
 }
コード例 #3
0
ファイル: commands.php プロジェクト: howareyoucolin/demo
 public function VisitIsNullFieldFilter($filter)
 {
     $this->resultCondition = $this->engCommandImp->GetIsNullCoditition($this->engCommandImp->GetFieldFullName($this->field));
 }
コード例 #4
0
 public function GetFieldValueAsSQL($fieldInfo, $value)
 {
     if ($fieldInfo->FieldType == ftBoolean) {
         if (!is_numeric($value) || !($value == 0 || $value == 1)) {
             RaiseError("The only valid values for the column {$fieldInfo->Name} are 0 and 1.");
         }
         return $this->EscapeString($value);
     } else {
         return parent::GetFieldValueAsSQL($fieldInfo, $value);
     }
 }
コード例 #5
0
 public function ExecuteInsertCommand($connection, $command)
 {
     if ($command->GetAutoincrementInsertion()) {
         $this->EnableIdentityInserts($connection, $command->GetTableName(), true);
     }
     parent::ExecuteInsertCommand($connection, $command);
     if ($command->GetAutoincrementInsertion()) {
         $this->EnableIdentityInserts($connection, $command->GetTableName(), false);
     }
 }
コード例 #6
0
ファイル: oracle_engine.php プロジェクト: kcallow/MatchMe
 public function DoExecuteCustomSelectCommand($connection, $command)
 {
     $upLimit = $command->GetUpLimit();
     $limitCount = $command->GetLimitCount();
     if (isset($upLimit) && isset($limitCount)) {
         $sql = sprintf('SELECT * FROM (SELECT RowNum as MAESTRO_ROWNUM, T.* FROM (%s) T) WHERE MAESTRO_ROWNUM BETWEEN %s AND %s', $command->GetSQL(), $upLimit + 1, $upLimit + $limitCount);
         $result = $this->GetConnectionFactory()->CreateDataset($connection, $sql);
         $result->Open();
         return $result;
     } else {
         return parent::DoExecuteCustomSelectCommand($connection, $command);
     }
 }