views:

105

answers:

1

My delete query does not work conditionaly, it deletes all the records from tne table

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;

Please, help.

A: 

There's not really enough info to go on, but I could make a couple guesses.

  • Does TMS_ENTITY_COUNT have two columns named logon_id and str_logon_id? Are they both equal all the time?
  • Depending on your flavor of SQL, do you need an @ or : symbol before your variable name as in ...WHERE logon_id = @str_logon_id?
lc
Thanks for the help.My tms_entity_count has a few columns, one od them is user_logon_id.I try to delete records from this table which have values, specified by input paramter. If I use @str_logon_id and :str_logon_id the procedure is not compiled.