Click here to Skip to main content
12,501,472 members (57,184 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# VB ASP.NET MySQL VB.NET
Hi Friends,,


How to create a stored procedure in MySql which doesn't take any parameters.

I tried following code:


Create procedure loadGrid()
as
begin 
select *from custdetails
end 

but i m getting error..

Query : CREATE PROCEDURE custdetailLoad() BEGIN SELECT *FROM custdetail end
Error Code : 1064
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 '' at line 4
Execution Time : 00:00:00:000
Transfer Time : 00:00:00:000
Total Time : 00:00:00:000

please give me a solution
Posted 21-Jan-13 20:48pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Please try below code.
CREATE PROCEDURE loadGrid()
BEGIN
    SELECT * FROM custdetails;
END
Please read more about stored procedure using this LINK.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

This is how you do it

CREATE PROCEDURE [dbo].[loadGrid]
 
AS
BEGIN
      SELECT * FROM custdetails
 
END
GO
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160919.1 | Last Updated 19 Mar 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100