Click here to Skip to main content
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 OriginalGriff 310
1 Sergey Alexandrovich Kryukov 176
2 PhilLenoir 164
3 Richard MacCutchan 160
4 Sharmanuj 146
0 Sergey Alexandrovich Kryukov 6,081
1 OriginalGriff 5,115
2 CPallini 2,473
3 Richard MacCutchan 1,597
4 Abhinav S 1,505


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