Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: URGENT NEED OF HELP ABOUT PL/SQL
Hi Matteo !
Matteo Lonardi wrote:
> I have the following code:
>
> SELECT COUNT(*) INTO counter FROM event WHERE event_code=cev;
>
> My problem is that an error occurs and I'm not able to understand why.
Which error did you get ?
> I've tried to change the row and write:
>
> SELECT TO_CHAR(COUNT(*),'9') INTO string_counter FROM event WHERE
> event_code=cev;
>
> This one works BUT there is another problem: I have to know how many
> rows exist in order to declare the right dimension of string_count but
>
> if I knew this information I could avoid to do the SELECT.
>
Don't think so, because count(*) is a group function an returns always one record.If you need to fetch unknown count of values, try to use PL/SQL-Tables !
> Well, does anybody know how can I solve it?
> Thanks in advance.
>
> Lonardi Matteo
> teo_at_romeo.sci.univr.it
Regards
Dante A. Notari-Locher
Received on Fri Aug 29 1997 - 00:00:00 CDT
![]() |
![]() |