@C:\Users\4\Desktop\dbdrop;
@C:\Users\4\Desktop\dbcreate;
SET SERVEROUTPUT ON;
DECLARE
ORDER_ID ORDERS.ODID%TYPE;
COMPANY_NAME ORDERS.CNAME%TYPE;
ORDER_DATE ORDERS.ODATE%TYPE;
CURSOR ord_cursor IS
SELECT ODID, CNAME, ODATE
FROM ORDERS;
BEGIN
for ord_cursor in
(select odid, cname, odate
from orders
where order_date < trunc(sysdate)
and rownum <= 5
)
loop
dbms_output.put_line('Order ID = ' || ord_cursor.odid);
dbms_output.put_line('Order date = ' || ord_cursor.odate);
dbms_output.put_line('Company = ' || ord_cursor.cname);
end loop;
END;
ORA-06550: line 2, column 24:
PLS-00302: component 'ODID' must be declared
ORA-06550: line 2, column 17:
PL/SQL: Item ignored
ORA-06550: line 3, column 24:
PLS-00302: component 'CNAME' must be declared
ORA-06550: line 3, column 17:
PL/SQL: Item ignored
ORA-06550: line 4, column 24:
PLS-00302: component 'ODATE' must be declared
ORA-06550: line 4, column 17:
PL/SQL: Item ignored
ORA-06550: line 6, column 29:
PL/SQL: ORA-00904: "ODATE": invalid identifier
ORA-06550: line 6, column 9:
PL/SQL: SQL Statement ignored
ORA-06550: line 10, column 25:
PL/SQL: ORA-00904: "ODATE": invalid identifier
ORA-06550: line 10, column 6:
PL/SQL: SQL Statement ignored
ORA-06550: line 16, column 45:
PLS-00364: loop index variable 'ORD_CURSOR' use is invalid
ORA-06550: line 16, column 5:
PL/SQL: Statement ignored
ORA-06550: line 17, column 45:
PLS-00364: loop index variable 'ORD_CURSOR' use is invalid
ORA-06550: line 17, column 5:
PL/SQL: Statement ignored
ORA-06550: line 18, column 45:
PLS-00364: loop index variable 'ORD_CURSOR' use is invalid
ORA-06550: line 18, column 5:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action: