2016-08-09 19 views
0

こんにちは私はテーブルを作成し、今はストアドプロシージャを作成しています。作成プロシージャのmysql構文エラー1064

CREATE PROCEDURE p_order_insert (in in_agent_id Varchar(10),in in_rate_city varchar(15),in in_sendername varchar(50),in in_senderaddress1 varchar(50),in in_senderaddress2 varchar(50),in in_senderaddress3 varchar(50),in in_senderaddress4 varchar(50),in in_sendercity varchar(50),in in_senderstate varchar(50),in in_senderpostcode varchar(10),in in_sendercountry varchar(15),in in_receivername varchar(50),in in_receiveraddress1 varchar(50),in in_receiveraddress2 varchar(50),in in_receiveraddress3 varchar(50),in in_receiveraddress4 varchar(50),in in_receivercity varchar(50),in in_receiverstate varchar(50),in in_receiverpostcode varchar(10),in in_receivercountry varchar(15),in in_item1_description varchar(80),in in_item2_description varchar(80),in in_item3_description varchar(80),in in_item4_description varchar(80),in in_item5_description varchar(80),in in_item6_description varchar(80),in in_item1_quantity int,in in_item2_quantity int,in in_item3_quantity int,in in_item4_quantity int,in in_item5_quantity int,in in_item6_quantity int,in in_item1_weight double,in in_item2_weight double,in in_item3_weight double,in in_item4_weight double,in in_item5_weight double,in in_item6_weight double,in in_item1_value double,in in_item2_value double,in in_item3_value double,in in_item4_value double,in in_item5_value double,in in_item6_value double,in in_order_status Varchar(10),in in_total_price double,in in_agent_commission double,in in_payment_received Varchar(10), OUT out_awb_ref_id Varchar (10)) BEGIN 
INSERT INTO hvp_order_master (agent_id, rate_city, sendername, senderaddress1, senderaddress2, senderaddress3, senderaddress4, sendercity, senderstate, senderpostcode, sendercountry, receivername, receiveraddress1, receiveraddress2, receiveraddress3, receiveraddress4, receivercity, receiverstate, receiverpostcode, receivercountry, item1_description, item2_description, item3_description, item4_description, item5_description, item6_description, item1_quantity, item2_quantity, item3_quantity, item4_quantity, item5_quantity, item6_quantity, item1_weight, item2_weight, item3_weight, item4_weight, item5_weight, item6_weight, item1_value, item2_value, item3_value, item4_value, item5_value, item6_value, order_status, total_price, agent_commission, payment_received) 
VALUES 
(in_agent_id, in_rate_city, in_sendername, in_senderaddress1, in_senderaddress2, in_senderaddress3, in_senderaddress4, in_sendercity, in_senderstate, in_senderpostcode, in_sendercountry, in_receivername, in_receiveraddress1, in_receiveraddress2, in_receiveraddress3, in_receiveraddress4, in_receivercity, in_receiverstate, in_receiverpostcode, in_receivercountry, in_item1_description, in_item2_description, in_item3_description, in_item4_description, in_item5_description, in_item6_description, in_item1_quantity, in_item2_quantity, in_item3_quantity, in_item4_quantity, in_item5_quantity, in_item6_quantity, in_item1_weight, in_item2_weight, in_item3_weight, in_item4_weight, in_item5_weight, in_item6_weight, in_item1_value, in_item2_value, in_item3_value, in_item4_value, in_item5_value, in_item6_value, in_order_status, in_total_price, in_agent_commission, in_payment_received); END;; 

しかし、私は

1064を取得しています - Erreurデsyntaxe PRASド '' ア・ラ・LIGNE 6私が見ることができる、そのような問題はありません。

誰かに助けてもらえますか?

+1

これはSLAB OF CODEです。あなたがそれを読むことができるようにそれをフォーマットしますか?私はそれをやろうとしていましたが、たくさんのコードがあります。 _助言が必要な場合はis_ – RiggsFolly

+1

___Ligne 6___がコード内で___Line 6となるように書式を設定する___現在のところ4行しかありません – RiggsFolly

答えて

1

DELIMITERラッパーを含めると、以下のように保存されます。

また、スキーマ設計が貧弱であると確信しています。

DROP PROCEDURE IF EXISTS p_order_insert; 
DELIMITER $ 
CREATE PROCEDURE p_order_insert 
(in in_agent_id Varchar(10), 
in in_rate_city varchar(15), 
in in_sendername varchar(50), 
in in_senderaddress1 varchar(50), 
in in_senderaddress2 varchar(50), 
in in_senderaddress3 varchar(50), 
in in_senderaddress4 varchar(50), 
in in_sendercity varchar(50), 
in in_senderstate varchar(50), 
in in_senderpostcode varchar(10), 
in in_sendercountry varchar(15), 
in in_receivername varchar(50), 
in in_receiveraddress1 varchar(50), 
in in_receiveraddress2 varchar(50), 
in in_receiveraddress3 varchar(50), 
in in_receiveraddress4 varchar(50), 
in in_receivercity varchar(50), 
in in_receiverstate varchar(50), 
in in_receiverpostcode varchar(10), 
in in_receivercountry varchar(15), 
in in_item1_description varchar(80), 
in in_item2_description varchar(80), 
in in_item3_description varchar(80), 
in in_item4_description varchar(80), 
in in_item5_description varchar(80), 
in in_item6_description varchar(80), 
in in_item1_quantity int, 
in in_item2_quantity int, 
in in_item3_quantity int, 
in in_item4_quantity int, 
in in_item5_quantity int, 
in in_item6_quantity int, 
in in_item1_weight double, 
in in_item2_weight double, 
in in_item3_weight double, 
in in_item4_weight double, 
in in_item5_weight double, 
in in_item6_weight double, 
in in_item1_value double, 
in in_item2_value double, 
in in_item3_value double, 
in in_item4_value double, 
in in_item5_value double, 
in in_item6_value double, 
in in_order_status Varchar(10), 
in in_total_price double, 
in in_agent_commission double, 
in in_payment_received Varchar(10), 
OUT out_awb_ref_id Varchar (10)) 
BEGIN 
INSERT INTO hvp_order_master (agent_id, rate_city, sendername, senderaddress1, senderaddress2, 
senderaddress3, senderaddress4, sendercity, senderstate, senderpostcode, sendercountry, 
receivername, receiveraddress1, receiveraddress2, receiveraddress3, receiveraddress4, 
receivercity, receiverstate, receiverpostcode, receivercountry, item1_description, 
item2_description, item3_description, item4_description, item5_description, 
item6_description, item1_quantity, item2_quantity, item3_quantity, item4_quantity, 
item5_quantity, item6_quantity, item1_weight, item2_weight, item3_weight, item4_weight, 
item5_weight, item6_weight, item1_value, item2_value, item3_value, item4_value, item5_value, 
item6_value, order_status, total_price, agent_commission, payment_received) 
SELECT 
in_agent_id, in_rate_city, in_sendername, in_senderaddress1, in_senderaddress2, 
in_senderaddress3, in_senderaddress4, in_sendercity, in_senderstate, in_senderpostcode, 
in_sendercountry, in_receivername, in_receiveraddress1, in_receiveraddress2, in_receiveraddress3, 
in_receiveraddress4, in_receivercity, in_receiverstate, in_receiverpostcode, in_receivercountry, 
in_item1_description, in_item2_description, in_item3_description, in_item4_description, 
in_item5_description, in_item6_description, in_item1_quantity, in_item2_quantity, in_item3_quantity, 
in_item4_quantity, in_item5_quantity, in_item6_quantity, in_item1_weight, in_item2_weight, 
in_item3_weight, in_item4_weight, in_item5_weight, in_item6_weight, in_item1_value, in_item2_value, 
in_item3_value, in_item4_value, in_item5_value, in_item6_value, in_order_status, in_total_price, 
in_agent_commission, in_payment_received; 
END$$ 
DELIMITER ; 

DELIMITERの必要性は、使用するクライアントサイドツールによって異なります。 PHPMyAdminの場合は、通常は必要ありません。

これはMySQL Workbenchです。

+0

Drewさんに感謝しますが、#1064でエラーが発生しています - Erreur de syntaxeprèsde '' la ligne 72 – Nash

+0

今はいかがですか。起床してコーヒーが必要 – Drew

+0

何か変わった? – Nash

0

DELIMITER @@を先頭に追加します。また、コードの最後には;が2回あります。 END;; 1で十分です。

DELIMITER @@ 
CREATE PROCEDURE... 
[email protected]@ 
DELIMITER; 
関連する問題