Recent Posts
XML | 6 sec ago
None | 38 sec ago
None | 2 min ago
Bash | 2 min ago
None | 2 min ago
PHP | 2 min ago
None | 2 min ago
None | 2 min ago
Prolog | 3 min ago
None | 3 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By Anonymous on the 9th of Feb 2010 11:09:30 PM
Download |
Raw |
Embed |
Report
CREATE PROCEDURE pegarTudoEmUmaLinha()
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE linha, idCampo VARCHAR(255);
DECLARE queryDesejada CURSOR FOR SELECT id FROM tabela1;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
OPEN queryDesejada;
REPEAT
FETCH queryDesejada INTO idCampo;
SET linha = CONCAT(linha," ",idCampo);
UNTIL done
END REPEAT;
CLOSE queryDesejada;
END
Submit a correction or amendment below.
[ previous version ] | [ difference ] | Make A New Post