MySQL Forums
Forum List  »  Stored Procedures

Whats wrong with my stored procedure
Posted by: Akash Vachhani
Date: October 24, 2017 11:31AM

DELIMITER $$
CREATE DEFINER=`root`@`ipaddressgoeshere PROCEDURE `sp_createUser`(
IN p_fname VARCHAR(20),
IN p_lname VARCHAR(20),
IN p_username VARCHAR(20),
IN p_password VARCHAR(20),
IN p_pic VARCHAR(120)
)
BEGIN
if ( select exists (select 1 from tbl_user where user_username = p_username) ) THEN

select 'Username Exists !!';

ELSE

insert into tbl_user
(
user_fname,
user_lname,
user_username,
user_password,
user_pic
)
values
(
p_fname,
p_lname,
p_username,
p_password,
p_pic
);

END IF;
END$$
DELIMITER ;



The error i get on workbench is please use SQL statements. std::execution

Options: ReplyQuote


Subject
Views
Written By
Posted
Whats wrong with my stored procedure
3225
October 24, 2017 11:31AM


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.