Click here to Skip to main content
11,637,662 members (77,947 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# 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
0 Sergey Alexandrovich Kryukov 309
1 stibee 288
2 OriginalGriff 285
3 jyo.net 250
4 Mika Wendelius 189
0 OriginalGriff 9,031
1 Sergey Alexandrovich Kryukov 8,763
2 Mika Wendelius 6,999
3 F-ES Sitecore 2,388
4 Suvendu Shekhar Giri 2,320


Advertise | Privacy | Mobile
Web02 | 2.8.150728.1 | Last Updated 19 Mar 2013
Copyright © CodeProject, 1999-2015
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