2010-04-14 31 views
0

我用下面的mysql程序,這個mysql存儲過程有什麼問題?

DROP PROCEDURE IF EXISTS `allied`.`GetRegistrationData`$$ 
CREATE DEFINER=`allied`@`%` PROCEDURE `GetRegistrationData`() 

BEGIN 
select aboutUsId,name from aboutus where isDeleted=0 
select ageId,name from age where isDeleted=0 
select desiredsetId,name from desiredsetting where isDeleted=0 
select disciplineId,name from discipline where isDeleted=0 
select employeementId,name from employeement where isDeleted=0 
select salutationId,name from salutation where isDeleted=0 
select timeId,name from timetocall where isDeleted=0 
END$$ 

DELIMITER ; 

當我執行此我得到一個錯誤,

Error Code : 1064 
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 ageId,name from age where isDeleted=0 
select desiredsetId,name from desir' at line 4 

任何建議...

+1

不要SELECT語句需要關閉';'? – 2010-04-14 11:36:39

+0

@pekka可以調整我的存儲過程,使其更快,因爲有多個選擇語句。 – bala3569 2010-04-14 11:38:32

+0

你能給我們你試圖實現的結果嗎? – 2010-04-14 11:39:45

回答

3

你錯過了分號,在每年年底SELECT line

2

您只需用分號終止您的SELECT語句即可修復該錯誤。

+0

@丹尼爾看看我的問題的意見,並建議我.. – bala3569 2010-04-14 11:44:15

+2

@bala你目前的問題是完全不同於你的原始問題。我認爲接受其中一個答案(可能會投擲一枚硬幣:)並開始一個新的答案是適當的。 – 2010-04-14 11:48:08

+0

我選擇「正面」:) – 2010-04-14 11:49:05