truncate table output
/
-------------------------------------------------------------------------------
-- Example of IF/ELSIF/ELSE statement
-------------------------------------------------------------------------------
DECLARE 
    vendor payment.vendor%type;             -- same type as the column 
    amount payment.amount%type;
BEGIN
    SELECT vendor, amount                   -- from the table columns  
      INTO vendor, amount                   -- into the variables 
      FROM payment
     WHERE payment_num = 5;

    INSERT INTO output values('----Using IF----');
    IF amount <= 50 THEN     
        INSERT INTO output 
            VALUES('payment: $' || amount || ' is small');
    ELSIF amount > 50 and amount <= 100 THEN     
        INSERT INTO output 
            VALUES('payment: $' || amount || ' is medium size');
    ELSIF amount > 100 and amount <= 250 THEN     
        INSERT INTO output 
            VALUES('payment: $' || amount || ' is large');
    ELSE      
        INSERT INTO output 
            VALUES('payment: $' || amount || ' is expensive');
    END IF;
END;
/

select * from output