Re: SELECT... INTO... problem
From: TurkBear <johng_at_mm.com>
Date: 2000/05/25
Message-ID: <392d8be0.25070088_at_news.news-ituk.to>#1/1
Create or Replace procedure Countit is
nbr integer;
begin
select count(*) into nbr from my_employees; dbms_output.put_line('There are '||nbr||' employees in the table'); end;
Date: 2000/05/25
Message-ID: <392d8be0.25070088_at_news.news-ituk.to>#1/1
[Quoted] Please post your procedure - it should work:
I built the following
Create or Replace procedure Countit is
nbr integer;
begin
select count(*) into nbr from my_employees; dbms_output.put_line('There are '||nbr||' employees in the table'); end;
[Quoted] This returns the following
SQL> Exec Countit
There are 790 employees in the table
pete_karanikas_at_hotmail.com wrote:
>Why won't this work? (it's within a procedure)
>
>select count(*) into p_count
>from user_tables;
>
>The p_count has been declared as an INTEGER and is always returned as a
>value of 0.
>
>Any ideas?
>
>Pete
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
[Quoted] -----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 80,000 Newsgroups - 16 Different Servers! =----- Received on Thu May 25 2000 - 00:00:00 CEST