P********R 发帖数: 1691 | 1 下面这个哪儿不对
DECLARE
vPartid NUMBER (4);
vDescription VARCHAR2 (265);
vPrice NUMBER (7, 2);
BEGIN
SELECT Partid, Description, Price
INTO vPartid, vDescription, vPrice
FROM INVENTORY
WHERE Price = (SELECT MAX (price) FROM INVENTORY);
DBMS_OUTPUT.PUT_LINE ('Part Number ' || vPartid ||
'described as ' || vDescription ||
'is the hightest priced item in inventroy at ' ||
TO_CHAR(vPrice,'$9999.99') );
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('OTHERS EXCEPTION');
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
PLS-00103: Encountered the symbol " " when expecting one of the
following:
begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<< close current delete fetch lock insert
open rollback savepoint set sql execute commit forall merge
pipe
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action: | r***r 发帖数: 123 | 2 exception
when no_data_found then
do sth here;
and
put / under "end;" | P********R 发帖数: 1691 | 3 谢谢!
【在 r***r 的大作中提到】 : exception : when no_data_found then : do sth here; : and : put / under "end;"
|
|