989546 wrote:what is result from SQL below?
Can anyone help me whats wrong in this procedure. When im calling the procedure like call UR('0010','%02','King',225) its not updating the values for tuples with HOTELID = hId and roomno having pattern '%02'!!
CREATE OR REPLACE PROCEDURE UR(hId IN CHAR, rIdPattern IN CHAR, rType IN CHAR, rPrice IN INT) IS
CURSOR c IS
SELECT HOTELID, ROOMNO FROM ROOM WHERE HOTELID = hId AND ROOMNO LIKE rIdPattern
FETCH c INTO thId, trId;
EXIT WHEN c%NOTFOUND;
UPDATE ROOM SET TYPE=rType , PRICE = rPrice WHERE HOTELID = thId AND ROOMNO = trId;