PLS-00394: Wrong number of values in the INTO list of a fetch statement

后端 未结 3 1891
感动是毒
感动是毒 2021-01-28 11:28

This is my attempt in creating a cursor in a stored procedure

   --Second Stored Procedure--
 CREATE OR REPLACE PROCEDURE sp_GetDiscountedRate (DiscountCode IN           


        
3条回答
  •  长发绾君心
    2021-01-28 12:30

    You have

    12 columns in your cursor's SELECT part

    but

    11 columns in FETCH statement part

    , i observe

    CASE U.MilitaryDiscountCode WHEN DiscountCode THEN   
      Percentage*R.ReservationCost 
      ELSE R.ReservationCost END "REVISED_RESERVATION_COST"
    

    part is missing in FETCH( or should be omitted in the SELECT part ).

    It also represents a column, and it spoils 1-1 correspondence, which yields that error.

提交回复
热议问题