Re: pl/sql simple prob but .....

From: New Age <parbha_at_iquest.net>
Date: 1996/01/25
Message-ID: <DLpHIn.AF8_at_iquest.net>#1/1


ravirai_at_winternet.com (Ravi Rai) wrote:

>Hi
 

>I am very new to PL/SQL. I wrote this program to see if I can use
>variables for table names. But I always end up in error.
 

>I appreciate any feedback.
>------------------------
>create or replace procedure rktest as
>cursor tbl_name is
> select table_name
> from user_tables
> order by table_name;
 

>rec_count number;
 

>begin
> dbms_output.put_line(' ************* ');
> DBMS_OUTPUT.PUT_LINE ('');
> DBMS_OUTPUT.PUT_OUTPUT.PUT_LINE ('');
> for lp_val in tbl_name loop
 

> select count (*)
> into rec_count
> from lp_val.table_name#;
 

> DBMS_OUTPUT.PUT_LINE ('Table :'||lp_val.table_name);
> DBMS_OUTPUT.PUT_LINE ( ' recs: ' || rec_count);
> DBMS_OUTPUT.PUT_LINE ('');
> end loop;
>end rktest;
>/
>compilation Error:
>15/10 PLS-00356: 'LP_VAL.TABLE_NAME' must name a table to which the
> user has access
 

>----
 

>Thanks
 

>Ravi

Use DBMS_SQL package,we get your results: Text of this package can be printed from the system tables. spool on
select text from all_source where name = 'DBMS_SQL'; spool off
If you want source code, write to prabha_at_lilly.com. I currently don't have it in home.

Prabha Received on Thu Jan 25 1996 - 00:00:00 CET

Original text of this message