我寫了一個函數,在這裏我刪除了一個表中的行號。我不明白的錯誤當執行函數pl/sql時出錯
DECLARE
a integer ;
CREATE OR REPLACE function f (j sejour.jour%type) return integer is
n integer
begin
select count(*) into n from sejour where jour < j ;
Delete Sejour where jour < j ;
RETURN n ;
end;
BEGIN
a:= 5;
c := f(a);
dbms_output.put_line(' Nombre est : ' || c);
END;
/
我有錯誤:
ERROR at line 4:
ORA-06550: line 4, column 1:
PLS-00103: Encountered the symbol "CREATE" when expecting one of the following:
begin function pragma procedure subtype type <an identifier>
<a double-quoted delimited-identifier> current cursor delete
exists prior
其實後'create'你不需要'declare'在所有 –