Solved

testing stored procedure

Posted on 2006-10-20
3
215 Views
Last Modified: 2012-08-13
I've written a mysql procedure that I am trying to run/test in a query analyzer and obtain the return value. The client is aqua data studio on windows.

In my mind, the code would be something like (i'm new to mysql):

call proc_myproc(@return,1);
select @test;

The intention is that the contents of @test would be shown in the results pane. However, running this returns the error:

 W (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 ';
select @test' at line 1

How can I run more than 1 command in a single request like this? Can I do it outside of a procedure or function? Both lines evaluate/run fine in isolation.
0
Comment
Question by:pat333
3 Comments
 
LVL 14

Accepted Solution

by:
racek earned 75 total points
ID: 17776391
start with

CREATE PROCEDURE myprc (OUT return int)
BEGIN
....
END

then
CALL ..

se: http://dev.mysql.com/doc/refman/5.1/en/create-procedure.html
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now