MySQL Forums
Forum List  »  General

SQL Syntax Error
Posted by: C R
Date: January 02, 2012 05:53AM

Hello,

I am in the process of upgrading our MySQL version from 5.1.49 to 5.5.18. In doing so, I have encountered the following error in a function that used to work in 5.1.49 upon sourcing:

"ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(),'lookup value not found');"

Below is an exerpt from my function:

drop function if exists error;

delimiter //
create function error()
returns varchar(128)
begin
return 'ERROR - ';
end //

drop function if exists myProblemFunction;

delimiter //
create function myProblemFunction
(p_hostName varchar(128),
p_systemName varchar(128))
returns varchar(128)
begin
declare cnt smallint default 0;
declare p_hostNameId smallint unsigned default 0;
declare p_systemNameId smallint unsigned default 0;
declare returnVal varchar(128) default '';

declare exit handler for not return concat(error(), 'lookup value not found');

select hostNameId from LogicalHosts where hostName = p_hostName into p_hostNameId;

.
.
.
end //

Any input is greatly appreciated.

Options: ReplyQuote


Subject
Written By
Posted
SQL Syntax Error
C R
January 02, 2012 05:53AM
January 02, 2012 12:31PM
C R
January 03, 2012 05:38AM
January 03, 2012 10:37AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.