即时通讯有一个错误我现在很沮丧。我认为由于这个错误,我还有另一个错误,在表中添加检查约束时不能引用其他列。我必须在检查约束中使用这个函数来比较结束时间。警告:函数创建编译错误
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