Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Procedure Problem
Kuldeep wrote:
> create procedure tab_rows
> IS
> tab_name varchar(50);
> declare cursor all_tabs is
> select table_name
> from user_tables;
> begin
> create table temptab (rowc number (10));
> open all_tabs;
> Loop
> fetch all_tabs into tab_name;
> insert into temptab(rowc) select
> count(*) from tab_name;
> exit when all_tabs%notfound;
> End loop;
> close all_tabs;
> End;
>
> temptab has only one column rowc(number)
>
> Objective : ; procedure will return count(*) of all user tables.
>
> But above procedure is giving Error :Procedure created with compilation
> errors.
>
> Can anybody has workaround over it
>
There are both syntactic and logical errors. The most obvious is
the "create table" call. You cannot execute a DDL inside a
PL/SQL block with a direct "create .." call. Try using "execute
immediate" instead.
Type "sho err" on the SQL prompt to see the errors.
Rgds
Amogh
Received on Fri Apr 21 2006 - 08:20:47 CDT
![]() |
![]() |