OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Strange issue in a stored procedure [SOLVED]

From: Nicolas Sebrecht (nicolas.s-devlaposte.net)
Date: Thu Aug 07 2008 - 09:38:05 CDT


Nicolas Sebrecht a écrit:

> mysql> CREATE DATABASE dbtest;
> mysql> DELIMITER $$
> mysql> DROP PROCEDURE IF EXISTS `dbtest`.`test`$$
> mysql> CREATE PROCEDURE `dbtest`.`test` (newf VARCHAR(130))
> -> BEGIN
> -> SET newf = REVERSE( SUBSTRING_INDEX( REVERSE (newf) , '/', 1));
> -> END$$
> mysql> DELIMITER ;
> mysql> CALL test ('/home/ftp/file.foo');
> ERROR 1305 (42000): FUNCTION dbtest.REVERSE does not exist

I found the mistake. The error was due to the white-space just after the
"REVERSE(" term.

So, the correct command is :
SET newf = REVERSE(SUBSTRING_INDEX(REVERSE(newf), '/', 1));

Thanks to all persons who tried to solve this problem.

I just lost a lot of time...

--
Nicolas Sebrecht

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql