MySQL Forums
Forum List  »  Stored Procedures

Re: Create stor procedure
Posted by: Peter Brawley
Date: January 10, 2015 11:43PM

You gorgot delimiter directives?

drop procedure if exists site_sp;
delimiter go
create procedure site_sp()
begin
  select count(*) from showsite;
end;
go
delimiter ;

But since the sproc has just one line of code, you can drop the begin-end, whereupon you can drop the delimiter too ...

drop procedure if exists site_sp;
create procedure site_sp()
select count(*) from showsite;

But then we have to ask, what problem are you trying to solve by putting this one line of code in an sproc?

Options: ReplyQuote


Subject
Views
Written By
Posted
2235
January 10, 2015 08:27PM
Re: Create stor procedure
986
January 10, 2015 11:43PM


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.