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); } }
private function GetFieldValueAsSQL($fieldName, $value) { $fieldType = $this->fields[$fieldName]; return $this->commandImp->GetFieldValueAsSQL(new FieldInfo('', $fieldName, $fieldType, ''), $value); }
public function VisitIsNullFieldFilter($filter) { $this->resultCondition = $this->engCommandImp->GetIsNullCoditition($this->engCommandImp->GetFieldFullName($this->field)); }
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); } }
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); } }
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); } }