错误ORA-06550& ORA-00933

时间:2015-06-09 13:49:03

标签: plsql

我收到以下错误:

ORA-06550: line 3, column 43:
PL/SQL: ORA-00933: SQL command not properly ended
ORA-06550: line 3, column 1:
PL/SQL: SQL Statement ignored

declare minimum number (10);
begin
SELECT MIN(SWLR_ASSET_ID) from SWLR_ASSET INTO minnumber where swlr_key=:p26_swlr_id;        
end; 

我认为它在某处有一个简单的语法错误,但据我所知,一切似乎都很好。当我取出并单独运行select语句然后它工作。

1 个答案:

答案 0 :(得分:1)

您的INTO位置错误,并且您还声明了一个名为minimum的变量,但随后被选入minnumber。正确的代码是:

declare minimum number (10);
begin
  SELECT MIN(SWLR_ASSET_ID)
  INTO minimum 
  from SWLR_ASSET 
  where swlr_key=:p26_swlr_id;        
end;