在存储过程中删除

时间:2009-02-24 02:30:00

标签: stored-procedures

我的删除查询无条件运行,它会删除表中的所有记录

PROCEDURE          "SP_NEW"    (
logon_id        IN  VARCHAR2,
id      IN  VARCHAR2,
key     IN  VARCHAR2,
error_code      OUT NUMBER,
error_message       OUT VARCHAR2)

...
PROCEDURE delete_counts(str_logon_id IN VARCHAR2)
IS
BEGIN
    DELETE FROM TMS_ENTITY_COUNT WHERE logon_id = str_logon_id;
END;

BEGIN;

delete_counts(logon_id);

END;

请帮助。

1 个答案:

答案 0 :(得分:0)

还没有足够的信息可以继续,但我可以做几个猜测。

  • TMS_ENTITY_COUNT有两列名为logon_idstr_logon_id吗?它们一直都是平等的吗?
  • 根据您的SQL风格,您是否需要在变量名前加上@或:符号,如...WHERE logon_id = @ str_logon_id