PL-SQL Problem

From: Joydeep Chakrabarty <c.joydeep_at_gmail.com>
Date: Sat, 02 Apr 2011 19:33:38 +0530
Message-ID: <4d972cbe$0$23752$14726298_at_news.sunsite.dk>



Hi,

I am using PL-SQL code to find out the number of rows in the tables in the user XYZ.

set serveroutput on;
DECLARE
    sqlstr VARCHAR2(1000);
    cnt NUMBER;
BEGIN
    FOR v_rec IN (SELECT table_name FROM all_tables WHERE OWNER = 'XYZ') loop

        sqlstr := 'select count(*) into cnt from ' || v_rec.table_name ;

--      DBMS_OUTPUT.PUT_LINE(sqlstr);
        EXECUTE IMMEDIATE sqlstr;
        DBMS_OUTPUT.PUT_LINE(v_rec.table_name ||',' || cnt);
    END LOOP;
END; I am getting ORA-00905 "Missing Keyword" error. Please help. Thanks in advance,

Jaydip Received on Sat Apr 02 2011 - 09:03:38 CDT

Original text of this message