This is my attempt in creating a cursor in a stored procedure
--Second Stored Procedure--
CREATE OR REPLACE PROCEDURE sp_GetDiscountedRate (DiscountCode IN
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.