Skip to content

Commit

Permalink
Use LENGTHC function on oracle for length query function
Browse files Browse the repository at this point in the history
  • Loading branch information
tomneedham committed May 30, 2017
1 parent 6773568 commit 8fd0bf5
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,13 @@ public function iLike($x, $y, $type = null) {
$y = $this->helper->quoteColumnName($y);
return new QueryFunction('REGEXP_LIKE('.$x.', \'^\' || REPLACE('.$y.', \'%\', \'.*\') || \'$\', \'i\')');
}

/**
* Use LENGTHC on Oracle to return multi-byte safe number of characters not bytes.
* @inheritdoc
*/
public function length($column) {
$column = $this->helper->quoteColumnName($column);
return new QueryFunction("LENGTHC({$column})");
}
}

0 comments on commit 8fd0bf5

Please sign in to comment.