Answers for "delete table from other schema in oracle"

SQL
1

oracle sql drop table

DROP TABLE my_table;
-- To 'really' free space
DROP TABLE my_table PURGE;
Posted by: Guest on January-23-2021
3

oracle drop all schema tables

BEGIN
    FOR cur_rec IN (SELECT OBJECT_NAME, OBJECT_TYPE
                    FROM ALL_OBJECTS		-- Choose types
                    WHERE OBJECT_TYPE IN ('TABLE', 'VIEW', 'PACKAGE',
                                          'PROCEDURE', 'FUNCTION', 'SEQUENCE'))
                          AND OWNER = 'owner_name'
        LOOP
            BEGIN
                IF cur_rec.OBJECT_TYPE = 'TABLE'
                THEN
                    EXECUTE IMMEDIATE 'DROP ' || cur_rec.OBJECT_TYPE || ' "'
                        || cur_rec.OBJECT_NAME || '" CASCADE CONSTRAINTS';
                ELSE
                    EXECUTE IMMEDIATE 'DROP ' || cur_rec.OBJECT_TYPE || ' "'
                        || cur_rec.OBJECT_NAME || '"';
                END IF;
            EXCEPTION
                WHEN OTHERS
                    THEN
                        DBMS_OUTPUT.PUT_LINE('FAILED: DROP '
                            || cur_rec.OBJECT_TYPE || ' "'
                            || cur_rec.OBJECT_NAME || '"');
            END;
        END LOOP;
END;
Posted by: Guest on July-10-2021

Code answers related to "delete table from other schema in oracle"

Code answers related to "SQL"

Browse Popular Code Answers by Language