【发布时间】:2019-02-02 10:13:20
【问题描述】:
在Oracle 中,我需要在几个表中使用 ID 来更新值,我试图获取如下所示的值,然后分配给一个变量,然后尝试使用,但我收到错误
declare myVal varchar2;
BEGIN
begin
myVal := select ID from USER where USER_NUMBER = 53;
end;
Update myOtherTable1 SET VAL = myVal;
Update myOtherTable2 SET VAL = myVal
Update myOtherTable3 SET VAL = myVal
Update myOtherTable4 SET VAL = myVal
Update myOtherTable5 SET VAL = myVal
...........
END
错误
ORA-06550:第 4 行,第 14 列:PLS-00103:遇到符号 “SELECT”当期望以下之一时:
( - + case mod new not null continue avg count current 存在 max min prior sql stddev sum variance 执行 forall 合并 时间 时间戳 间隔 日期 管道
【问题讨论】:
-
从 ... 中选择 ID 到 myVal 中
标签: oracle