0

次のようにmysqlでストアドプロシージャを作成しているときに、次のエラーが発生します

ERROR 1064 (42000): 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 '' at line 8

以下は私のストアドプロシージャです

mysql> delimiter //

mysql> create procedure music_procedure(in movie_name varchar(100),in movie_image varchar(100),in music_director varchar(150),in cast varchar(150),in songtitle varchar(150),in duration time,in artist varchar(100),in lyricist varchar(100),in status varchar(50))

-> begin

->  if not exists (select movie_name from music where music.movie_name=movie_name) then

-> insert into music(movie_name,movie_image,music_director,cast) values(movie_name,movie_image,music_director,cast);

-> insert into music_details(songtitle,duration,artist,lyricist,status,music_id) values(songtitle,duration,artist,lyricist,status,(select music_id from music where music.movie_name=movie_name));

 -> else

-> insert into music_details(songtitle,duration,artist,lyricist,status,music_id) values(songtitle,duration,artist,lyricist,status,(select music_id from music where music.movie_name=movie_name));


-> end


-> //
4

2 に答える 2

0

あなたは単に行方不明END IF;です。ENDステートメントの直前に置いてください。

于 2013-08-02T06:06:05.493 に答える