-- oracle 9i -- code works something like this now: CURSOR c_user_tables IS SELECT table_name FROM user_tables ; begin FOR x IN c_user_tables LOOP BEGIN SELECT table_name INTO dummy FROM myTables WHERE table_name = x.Table_Name; sqlstmt := 'UPDATE myTables SET new_Rows = (select count(*) from ' || x.Table_Name|| ') WHERE Table_Name = ' || x.Table_Name||'; -- execute dynamic sql END; END LOOP; end; / Is there a way to get rid off the cursor looping. And 1. I don't want to use dynamic sql 2. I don't want to analyze user_tables 3. I want to update myTables is one sql statment, prefer using static sql. Possible? TIA. Guang ************************************************************************* PRIVILEGED AND CONFIDENTIAL: This communication, including attachments, is for the exclusive use of addressee and may contain proprietary, confidential and/or privileged information. If you are not the intended recipient, any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this communication and destroy all copies. ************************************************************************* -- //www.freelists.org/webpage/oracle-l