Oracle Procedure编译|警告:执行完成但有警告

Oracle Procedure compiled | Warning: execution completed with warning

我在 Oracle 中创建了下面提到的过程。它编译但给出警告说 "execution completed with warning"

create or replace
PROCEDURE check_upc
  (
  upc_id1  IN VARCHAR,
  upc_id2  IN VARCHAR,
  upc_id3  IN VARCHAR 
  )
IS  
BEGIN
  insert into testing2 SELECT upc_id1,upc_id2 from dual;
END;

但是当我将 SQL 语句更改为

insert into testing2 SELECT upc_id1,upc_id2,upc_id3 from dual;

编译时没有任何警告。

基本上,我应该 运行 一个长代码(~100 行)用于 10 个 UPC 组合(此过程中的参数),为此我将替换上面提到的 SQL 代码与我的实际代码。但是,这个基本的插入语句失败了。

提前致谢。

始终列出您用于 update:

的列
create or replace procedure check_upc (
  in_upc_id1  IN VARCHAR,
  in_upc_id2  IN VARCHAR,
  in_upc_id3  IN VARCHAR 
) IS  
BEGIN
  insert into testing2 (id1, id2)  -- or whatever the names are
      select in_upc_id1, in_upc_id2
      from dual;
END;

备注:

  • 我通常命名输入参数以将它们与局部变量和列名区分开来。
  • VARCHAR 看起来很奇怪。 Oracle 推荐 varchar2.
  • 使用insert时,列出列名。

警告本质上是在说:"This isn't going to work with the current table definition. But I'm accepting it because you might change the definition in the future and I really want to help you by not rejecting the stored procedure."