MySQL Forums
Forum List  »  Stored Procedures

Re: how to execute a procedure
Posted by: Jay Alverson
Date: December 24, 2008 09:08PM

If I understand you, you need to change the DELIMITER
The following is an example of a simple stored procedure that uses an OUT
parameter. The example uses the mysql client delimiter command to change the
statement delimiter from ; to // while the procedure is being defined. This
allows the ; delimiter used in the procedure body to be passed through to the
server rather than being interpreted by mysql itself. 


mysql> delimiter //

mysql> CREATE PROCEDURE simpleproc (OUT param1 INT)
    -> BEGIN
    ->   SELECT COUNT(*) INTO param1 FROM t;
    -> END;
    -> //
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter ;

Is that what you mean ?

>

Thanks, Jay

Options: ReplyQuote


Subject
Views
Written By
Posted
44213
December 24, 2008 12:40AM
Re: how to execute a procedure
21607
December 24, 2008 09:08PM
16655
January 05, 2009 10:18AM
15669
January 26, 2009 04:39AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.