deliFieldLeft = '"'; $this->deliFieldRight = '"'; $this->deliTableLeft = '"'; $this->deliTableRight = '"'; } public function concat($str1, $str2 = null) { return implode(' + ', func_get_args()); } /** * Given a SQL returns it with the proper LIMIT or equivalent method included * @param string $sql * @param int $start * @param int $qty * @return string * @throws NotAvailableException */ public function limit($sql, $start, $qty = null) { throw new NotAvailableException("DBLib does not support LIMIT feature."); } /** * Given a SQL returns it with the proper TOP or equivalent method included * @param string $sql * @param int $qty * @return string */ public function top($sql, $qty) { if (stripos($sql, ' TOP ') === false) { return preg_replace("/^\\s*(select) /i", "\\1 top $qty ", $sql); } return preg_replace( '~(\s[Tt][Oo][Pp])\s.*?\d+\s~', '$1 ' . $qty . ' ', $sql ); } /** * Return if the database provider have a top or similar function * @return bool */ public function hasTop() { return true; } /** * Return if the database provider have a limit function * @return bool */ public function hasLimit() { return false; } /** * Format date column in sql string given an input format that understands Y M D * * @param string $format * @param bool|string $column * @return string * @example $db->getDbFunctions()->SQLDate("d/m/Y H:i", "dtcriacao") */ public function sqlDate($format, $column = null) { if (is_null($column)) { $column = "getdate()"; } $pattern = [ 'Y' => "YYYY", 'y' => "YY", 'M' => "MM", 'm' => "M", 'Q' => "", 'q' => "", 'D' => "dd", 'd' => "dd", 'h' => "H", 'H' => "HH", 'i' => "mm", 's' => "ss", 'a' => "", 'A' => "", ]; $preparedSql = $this->prepareSqlDate($format, $pattern, ''); return sprintf( "FORMAT(%s, '%s')", $column, implode('', $preparedSql) ); } /** * @param DbDriverInterface $dbdataset * @param string $sql * @param array $param * @return bool|string */ public function executeAndGetInsertedId(DbDriverInterface $dbdataset, $sql, $param) { $insertedId = parent::executeAndGetInsertedId($dbdataset, $sql, $param); $iterator = $dbdataset->getIterator("select @@identity id"); if ($iterator->hasNext()) { $singleRow = $iterator->moveNext(); $insertedId = $singleRow->get("id"); } return $insertedId; } /** * @param $sql * @return string|void * @throws \ByJG\AnyDataset\Core\Exception\NotAvailableException */ public function forUpdate($sql) { throw new NotAvailableException('FOR UPDATE not available for Mssql/Dblib'); } public function hasForUpdate() { return false; } } __halt_compiler();----SIGNATURE:----LKFT4vt3w69oMuWS7GKQdic3x9bsTmMFDbc9OBWzLOTBIvpahFVOUcEfK/JURyWLFbm6bXMew1h3rbZfSvGzk3tnLjJGq/9lVzXX+oVAtsmYBlqaj5OZ+BhNoTTqcPBpRQDGybKqNtM4lBwotgQdbQFIgkjy3MoJHc1HPBh+FaPR2t/P9n3QH9wVZjiDHcZ973CB5rmqJGZeCn1kQ3W2Eogbn+vUXGp7tElp+gw/DndiX5FS1HfKt09d3SNy5YGRMoiziu5ZAv/iSJFboOWp+MjU4MX1MR14ie1qKRQ92BZ3Cxl0S31VoloZ1KD/xk4Gepd0yCEH9qVS2Wt/4Ad4QKVSL5UbEPjRcXll7Cx0Ks6UFrUDIA98mdOFVRoikBRZeIpbkukfmlv5CutwiEcZvc+E6HBeulPISn3PXUO7NxpMGU8w5m52n0PIwP6XFG2/bbiTQqbXayeQKkA+7p5VpLffylewV5kAjg7da36oV/czYvK6NL4eVgrmsdkheLOSzWbhHs//ix+jEpb0NWkMmKGohABLAxKChHViOztoV4/dgrLU4f4CNla94jlx6FPnGPoaw60eY62xqVR1R/6bSkZiBFcehRxcHpSJgUGqQhSmJ4EelQLMM1Ms/Gfe2roRccEQxxrZjqwZda2cNyuqh/V2WJGL2VEWHv3HTK1z47o=----ATTACHMENT:----OTg1ODU2OTk0MTQ0OTQyNiAzODMxNzk4MTI2ODQxNzc2IDYzMDkwOTE1NzA3OTk4NDM=