Solved

testing stored procedure

Posted on 2006-10-20
3
222 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

632 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