We're learning pl sql in class, and I was just wondering if anyone noticed any glaringly obvious errors in my code?
--Gets the phone number of a specific member
set SERVEROUTPUT on
DECLARE
phone_number Member_T.Phone%TYPE;
BEGIN
SELECT Phone
INTO phone_number
FROM Member_T
WHERE MemberCardNumber= 2436322287;
DBMS_OUTPUT.put_line (phone_number);
END;
--Uses a cursor to select the members with the top 3 highest account balances
set SERVEROUTPUT on
DECLARE
CURSOR b_cursor is
SELECT AccountID, Balance FROM Account_T
ORDER BY Balance DESC;
v_member Account_T.AccountID%type;
v_balance Account_T.Balance%type;
BEGIN
OPEN b_cursor;
FOR i IN 1..3 LOOP
FETCH b_cursor INTO v_accountID,v_balance;
EXIT WHEN b_cursor%NOTFOUND;
INSERT INTO temp VALUES (v_accountID,v_balance);
COMMIT;
END LOOP;
CLOSE b_cursor;
END;