[Phpmyadmin-devel] How to execute a multi query?

Michal Čihař michal at cihar.com
Wed May 25 16:32:55 CEST 2011


Hi

Dne Wed, 25 May 2011 15:19:52 +0100
Rouslan Placella <rouslan at placella.com> napsal(a):

> Yes, I am generating the query on the fly, but I'm not sure how I am
> supposed to split it. Here's a simple example that I don't know how to
> handle:
> 
> CREATE PROCEDURE `proc`(INOUT p INT(10))
> BEGIN
> SELECT 10 into p;
> END//
> 
> If I first try to execute
> 
> DELIMITER //
> 
> then PMA_DBI_query straight away returns the following error:
> 
> ERROR: Unknown Punctuation String @ 11
> STR: //
> SQL: DELIMITER //
> 
> Thanks again for any help with this.

You don't have to split it at all in this case :-). DELIMITER is not
handled by server for single query, so all you have to do is to issue:

CREATE PROCEDURE `proc`(INOUT p INT(10))
BEGIN
SELECT 10 into p;
END

For displaying purposes, DELIMITER statement might be added, so that
user can copy and paste the query.

-- 
	Michal Čihař | http://cihar.com | http://blog.cihar.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20110525/107fd94f/attachment.sig>


More information about the Developers mailing list