这是一个简单的预订/预订表:key 是 timeOfBooking 和 dateOfBooking 的 anId。
但是,当我尝试这样做时:插入 if-not-exist,更新 if-exist,关于与此代码链接到时间的标识符:
declare anId varchar[18];
declare aDate;
declare aTimeStamp;
set @anId =?;
set @aDate=?;
set @aTimeStamp=?;
if (exists (select * from Booking as t where t.AnId = @anId ))
begin update Booking set Date = @aDate and Time = @aTimeStamp where AnId= @anId end
else begin insert into Booking (AnId, Date, Time) values(@anId , @aDate, @aTimeStamp) end ;
我最终得到 jdbc 层返回此错误:
'varchar' is not a recognized CURSOR option.
知道有什么问题吗?