Solved

testing stored procedure

Posted on 2006-10-20
3
218 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 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