MySQL Forums
Forum List  »  Stored Procedures

Use of SUBSTRING_INDEX in a stored procedure ?
Posted by: yves ruff
Date: March 24, 2005 09:27AM

hi,

Is it possible to use the substring_index function in a stored procedure ?
The following code give the error message :
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 ')
BEGIN
DECLARE domain_name VARCHAR;
SELECT SUBSTRING_INDEX(login_par, '@', -1' at line 1

Mysql version 5.0.2-alpha-nt.

delimiter //

CREATE PROCEDURE AUTHENT (in login_par varchar)
BEGIN
DECLARE domain_name VARCHAR;
SELECT SUBSTRING_INDEX(login_par, '@', -1) INTO domain_name;
SELECT passwd, profile FROM user WHERE domaine = domaine_name;
END//


Regards,

--
yves

Options: ReplyQuote


Subject
Views
Written By
Posted
Use of SUBSTRING_INDEX in a stored procedure ?
6471
March 24, 2005 09:27AM


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.