Choosing a number in a variable in oracle

Hi, I tried this today and had no luck. This stored procedure does not work :(

CREATE OR REPLACE PROCEDURE LEAD_PURGE(closed IN DATE,
oprtr IN INTEGER,
leadscount OUT INTEGER)

is
BEGIN

SELECT COUNT(*) FROM LEADS_DELETED INTO leadscount;

COMMIT;
END LEAD_PURGE;
+5
source share
2 answers

The INTO sentence is inappropriate. It should be:

SELECT COUNT(*) INTO leadscount FROM LEADS_DELETED
+15
source

you have intoin the wrong place.

Try something like this and continue from there:

declare
  cnt number;
begin
  select count(*) 
  into cnt
  from leads_delete;
end;
+6
source

All Articles