Please help with these queries

SSuhaib

Member
Hi experts,

Progress 9.1e, Redhat, SQL explorer.

Urgent help needed to run below SQL & PL/SQL queries in SQL explorer.

1.
Description : To Know total row count from statistics available (with out running count(*) from that table)
SQL Statement :
SELECT num_rows FROM all_tables WHERE owner = '$table_owner' AND table_name = '$table_name'


2.
DECLARE
l NUMBER;
BEGIN
LOOP
DELETE FROM $tableOwner.$tableName
WHERE ROWNUM <= 10000;
l := sql%ROWCOUNT;
COMMIT;
IF l = 0 THEN
EXIT;
END IF;
END LOOP;
END;

3.
Select Statement to get Table, Num Of Rows details from Source instance.
SELECT OWNER, TABLE_NAME, NUM_ROWS FROM ALL_TABLES WHERE OWNER IN ($table_owner)


Warm Regards.
 
Top