16

Hi I have been trying this today and haven't had any 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;
0

3 Answers 3

34

The INTO clause is misplaced. It should be:

SELECT COUNT(*) INTO leadscount FROM LEADS_DELETED
Sign up to request clarification or add additional context in comments.

Comments

11

you have the into at the wrong place.

Try something like this instead and proceed from there:

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

Comments

0

Another way :

declare
  cnt number;
  cmd varchar2(100);
begin
  cmd := 'select count(*) from leads_delete';
  execute immediate cmd into cnt;
end;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.