i am having an error while using custom mysql function in doctrine query builders query string.
[Syntax Error] line 0, col 32: Error: Expected known function, got 'ucfirst'
mysql function is as below.
DELIMITER $$
DROP FUNCTION IF EXISTS `ucfirst`$$
CREATE FUNCTION `ucfirst`(str_value VARCHAR(5000)) RETURNS varchar(5000) CHARSET latin1 DETERMINISTIC
BEGIN
RETURN CONCAT(UCASE(LEFT(str_value, 1)),SUBSTRING(str_value, 2));
END$$
DELIMITER;
Doctrine query code is as below.
$qb = $this->em->createQueryBuilder();
$qb->select("ConcatWs(' ',ucfirst(p.firstName), ucfirst(p.lastName)) as user_name");
$qb->from('Entity\Profile', 'p');
$data = $qb->getQuery()->getResult();
print_r($data);exit;
any suggestions where i am doing wrong ?