-1
我想從表中顯示多行但我在運行腳本時顯示錯誤。我使用的Oracle 11g:SQL Developer的PL-SQL顯示多行
錯誤: PLS-00201:標識符 'DBMS.OUTPUT' 必須聲明爲
CREATE OR REPLACE PROCEDURE PRINT_ALL_CUSTOMERS AS
T_CUST_LASTNAME CUSTOMERS.LASTNAME%TYPE;
T_CUST_FIRSTNAME CUSTOMERS.FIRSTNAME%TYPE;
T_ORD_ORDERDATE ORDERS.ORDERDATE%TYPE;
T_ORD_SHIPDATE ORDERS.SHIPDATE%TYPE;
T_TOT_CUST INTEGER:=0;
CURSOR CUST_CURSOR IS
SELECT LASTNAME, FIRSTNAME
FROM CUSTOMERS;
BEGIN
OPEN CUST_CURSOR;
LOOP
FETCH CUST_CURSOR INTO T_CUST_LASTNAME, T_CUST_FIRSTNAME;
EXIT WHEN CUST_CURSOR%NOTFOUND;
DBMS_OUTPUT.PUT_LINE('NAME: ' || T_CUST_LASTNAME || ', ' || T_CUST_FIRSTNAME);
T_TOT_CUST := T_TOT_CUST + 1;
END LOOP;
CLOSE CUST_CURSOR;
DBMS.OUTPUT.PRINT_LINE('');
DBMS.OUTPUT.PRINT_LINE('NUMBER OF CUSTOMERS: ' || T_TOT_CUST);
END;
/
BEGIN
PRINT_ALL_CUSTOMERS;
END;
'DBMS_OUTPUT'而不是'DBMS.OUTPUT' – GabrielOshiro