Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Error creating Stored Procedure in MySQL Query Browser

Posted on 2005-04-25
11
Medium Priority
?
2,047 Views
Last Modified: 2008-01-09
Hi. I keep getting an error when I try to create a Stored Procedure using MySQL Query Browser.

Steps:
- Script menu -> Create Stored Procedure
- Input Procedure name and click create procedure

In the code textbox I am given this:

DELIMITER \\

DROP PROCEDURE IF EXISTS `stock`.`DisplayINTC`\\
CREATE PROCEDURE `stock`.`DisplayINTC` ()
BEGIN
END\\

DELIMITER ;

When I hit execute, I get the error:

"
Line 1:  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 'DELIMITER \\    Errornr. 1064

DROP PROCEDURE IF EXISTS 'stock','DisplayINTC'\\
CREATE PROCEDU' at line 1"


My schema name is stock
My table name is full

even when i add the following line between the BEGIN & END statements, I get the same error:
  select Date, Price from full where symbol = "INTC";

Any ideas?

Thanks!
0
Comment
Question by:oxygen_728
  • 4
  • 4
  • 3
11 Comments
 
LVL 8

Assisted Solution

by:nagki
nagki earned 800 total points
ID: 13861207
just try like this
1)first execute DELIMITER \\
2)then execute DROP PROCEDURE IF EXISTS `stock`.`DisplayINTC`\\
3)CREATE PROCEDURE `stock`.`DisplayINTC` ()
BEGIN
END\\
4)DELIMITER ;
    I don't think that at once we can't execute more than one statment..

0
 
LVL 8

Assisted Solution

by:nagki
nagki earned 800 total points
ID: 13861219
oops..small change in last line
 I don't think that at once we can execute more than one statment in Query Browser text box
0
 

Author Comment

by:oxygen_728
ID: 13861885
Bleh, I get an error even with:

DELIMITER \\


I don't know what to do.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
LVL 8

Assisted Solution

by:nagki
nagki earned 800 total points
ID: 13862287
Have u tried creating stored procedure from MySQL command prompt like this:
I am using MySQL 4.1 and tried thatt delimiter command on my version but could not get it to work with "DELIMITER \\"
but keeping a single character as delimiter is working

mysql> delimiter ?
mysql> select * from book ?
+--------+----------------+
| bookid | booktitle      |
+--------+----------------+
|      1 | mysql          |
|      2 | oracle         |
|      3 | mssql          |
|      4 | The ball is    |
|      4 | The ballard is |
|      4 | The Ballard is |
|      4 | Ballard is     |
+--------+----------------+
7 rows in set (0.00 sec)
0
 
LVL 14

Assisted Solution

by:cracky
cracky earned 1200 total points
ID: 13863557
oxygen_728:

CREATE PROCEDURE does not work until MySQL 5. What version are you running?
0
 

Author Comment

by:oxygen_728
ID: 13864104
Well, I upgraded to MySQL 5 today.

I'm using MySql Query Browser.. I wonder if that has anything to do with it
0
 
LVL 14

Assisted Solution

by:cracky
cracky earned 1200 total points
ID: 13864189
>  Well, I upgraded to MySQL 5 today.

Before or after you ran that query?

I don't know that the query browser would make much difference. Have you tried the same query from the MySQL monitor? Separating queries with ;
0
 

Author Comment

by:oxygen_728
ID: 13864794
yes, after I upgraded.

I'm not familiar with the MySQL monitor unfortunately, could you point me in the right direction please?
0
 
LVL 14

Accepted Solution

by:
cracky earned 1200 total points
ID: 13864833
I assume you're running on Windows:

Start > Run > cmd
C:\mysql\bin\mysql -u root -p

this will open a MySQL connection to localhost for root.

You can run queries in the monitor to get better feedback.

For example:

>USE databasename;
>SELECT * FROM `table`;

etc. Just as you would if you were using Query Browser, but sometimes it's easier to debug in the monitor, since all your queries are visible and errors are obvious.
0
 

Author Comment

by:oxygen_728
ID: 13873658
Still looking for some time to spend on this. Just letting you know I'm not abandoning =)
0
 
LVL 14

Assisted Solution

by:cracky
cracky earned 1200 total points
ID: 13873739
No problem. Take your time ;)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question