即時通訊有一個錯誤我現在很沮喪。我認爲由於這個錯誤,我還有另一個錯誤,在表中添加檢查約束時不能引用其他列。我必須在檢查約束中使用這個函數來比較結束時間。警告:函數創建編譯錯誤
1 create or replace function timing(dat in date, bran in varchar2(30), audi in number)
2 return number is time number
3 begin
4 select s_end into time from checking
5 where s_date=dat and branch=bran and a_id = audi;
6 return time;
7* end timing
SQL>/
,我的表是
Name Null? Type
----------------------------------------- -------- -------------
S_ID NOT NULL NUMBER
M_ID NUMBER
A_ID NUMBER
S_DATE DATE
S_START NUMBER
S_END NUMBER
BRANCH VARCHAR2(30)
的錯誤是:
1/46 PLS-00103: Encountered the symbol "(" when expecting following: := .) , @ % default character The symbol ":=" was substituted for "(" to continue.
3/1 PLS-00103: Encountered the symbol "BEGIN" when expecting the following: := . (@ % ; not null range default character
The symbol ";" was substituted for "BEGIN" to continue.
7/10 PLS-00103: Encountered the symbol "end-of-file" when expecting
'show errors'給你什麼? –
1/46 PLS-00103:遇到符號「(」時出現以下情況: :=。),@%默認字符 符號「:=」代替「(」繼續。3/1 PLS-00103 :遇到符號「BEGIN」時預期 以下內容: :=。(@%;非空範圍默認字符 符號「;」代替「BEGIN」繼續 7/10 PLS-00103:遇到當期待@a_horse_with_no_name時,符號「end-of-file」 – user3828413