Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 11th, 2004, 04:48 AM
Authorized User
Join Date: Jun 2003
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default Anyone knows what is wrong with this syntax?

I have test table called TEST1:
| id | context | Started |
| 1 | what ever | 2004-06-08 |
| 2 | second comments | 2004-06-08 |

I am creating the procedure called simpleproc in MySQL with input parameter, param1, then I want to return all rows where condition is - id=param1.
The syntax as I entered in MySQL:-
mysql> create procedure simpleproc (param1 int)
    -> BEGIN
    -> SELECT context,started FROM test1 WHERE id=param1;
ERROR 1064 (42000): 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 'SELE
CT context,started FROM test1 WHERE id=param1' at line 3

What is this error 1064 ?, anyone knows, SQL syntax for SELECT is OK!

Please help!, thanks in adv guys.

Old June 11th, 2004, 09:41 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

That is not a problem with SELECT syntax, the problem is that your procedure definition is incomplete.

Create Procedure

You have started with BEGIN, but where do you END your procedure?;)

-Vijay G
Strive for Perfection

Similar Threads
Thread Thread Starter Forum Replies Last Post
What's wrong here? nero XSLT 4 October 3rd, 2007 03:42 PM
what is wrong with this syntax crmpicco Classic ASP Databases 2 February 23rd, 2005 11:59 PM
Where did I go wrong??? ahc2inc VB.NET 2002/2003 Basics 3 September 28th, 2004 08:19 PM
Right or wrong? ÕÅÃÍ C++ Programming 6 February 27th, 2004 02:27 AM
What's wrong here? lyonsdigital Beginning PHP 2 August 7th, 2003 02:43 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.