If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Stored Procedure syntax

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-13-06, 12:48
spacdude spacdude is offline
Registered User
 
Join Date: Sep 2004
Location: UK
Posts: 15
Stored Procedure syntax

Hi

I am coming from a SQL background to write some stored procedures for MySQL now that it supports it, I'm having problems with the general syntax of a simple query that takes a variable in and uses it in the where clause of a select query and then returns a recordset.
Here is what I have that seems to be incorrect:

CREATE PROCEDURE test(in variablein int, out recordout int)
BEGIN
DECLARE recordout int;
set recordout = 'SELECT a FROM table WHERE (al = '" : variablein : "')';
END


Any help would be most appreciated, once i've got one correct I should get the idea for the rest.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On