#1109 - 未知表 - 调用过程

时间:2016-03-26 02:07:48

标签: mysql

我创建了一个新程序来从表中删除一行。

<div class="container">
  <br>
        <div class = "row">

                    <div id="myCarousel" class="carousel slide" data-ride="carousel ">

<ol class="carousel-indicators">
  <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
  <li data-target="#myCarousel" data-slide-to="1"></li>
  <li data-target="#myCarousel" data-slide-to="2"></li>

</ol>


<div class="carousel-inner" role="listbox">

  <div class="item active">
    <img src="css/pet9.jpg" alt="Chania">

  </div>

  <div class="item">
    <img src="css/pet10.jpg" alt="Chania">
  </div>

  <div class="item">
    <img src="css/pet8.jpg" alt="Flower" >

  </div>



</div>


<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
  <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
  <span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
  <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
  <span class="sr-only">Next</span>

</a>

     </div>

这是我称之为FALL2016的表格 enter image description here

1 个答案:

答案 0 :(得分:0)

您可以执行delete,然后计算受影响的行数:

DELIMITER //
CREATE PROCEDURE DropCourse ( IN Course_Id VARCHAR(10), IN Student_Id VARCHAR(10))
BEGIN
    delete from FALL2016
    where StudentId = Student_Id AND CourseId = Course_Id
    limit 1;

    select @rc := row_count();

    IF @rc > 0 THEN
        SELECT 'Course Deleted from Registry.'
    ELSE
        SELECT 'Not registered for course selected, no action taken.'
    END IF;
END;//

DELIMITER ;