Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- delimiter $
- create procedure p2(IN email VARCHAR(256))
- begin
- declare article_path VARCHAR(256);
- declare nfm1 INT;
- declare cursor1 cursor for select art_path from signed where sgn_jrn_email=email;
- declare continue handler for not found set nfm1=1;
- open cursor1;
- set nfm1=0;
- repeat
- declare nfm2 INT;
- fetch cursor1 into article_path;
- declare cursor2 cursor for select cat_id from belongs,category where bl_cat_id=cat_id and bl_art_path=article_path;
- declare continue handler for not found set nfm2=1;
- declare category_id INT;
- open cursor2;
- set nfm2=0;
- repeat
- fetch cursor2 into category_id;
- select cat_name from category where cat_id=category_id;
- select bl_art_path,art_title from belongs,category,article,signed where bl_cat_id=category_id and bl_art_path=art_path and sgn_art_path=art_path and sgn_jrn_email=email;
- until(nfm2=1)
- end repeat;
- close cursor2;
- until(nfm1=1)
- end repeat;
- close cursor1;
- end$
- 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 'declare nfm2 INT;
- fetch cursor1 INTO article_path;
- declare cursor2 cursor fo' at line 14
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement