Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Location
    London
    Posts
    16

    Unanswered: DB2 command for DROP USER CASCADE in oracle

    Does anyone know the equivalant command for

    DROP USER [username] CASCADE

    Basically in oracle this will drop a user and all there schema objects. When I try to use the db2 command:

    DROP SCHEMA [schemaname] RESTRICT

    I get the error:

    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0478N DROP or REVOKE on object type "SCHEMA" cannot be processed because
    there is an object "GIRS.ABBREVIATION", of type "TABLE", which depends on it.
    SQLSTATE=42893

    Is there no way in db2 to drop a user and all of their objects?

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: DB2 command for DROP USER CASCADE in oracle

    In DB2 , you cannot do that ...

    The schema name is a qualifier for a table rather than the name of the user (if not qualified, the schema defaults to the userid) ...

    So if you want to drop all user created objects of a particular user, use the DEFINER column in the SYSCAT.TABLES to scritp to identify the objects created by the user and drop them ....

    Cheers

    Sathyaram


    Originally posted by blakmk
    Does anyone know the equivalant command for

    DROP USER [username] CASCADE

    Basically in oracle this will drop a user and all there schema objects. When I try to use the db2 command:

    DROP SCHEMA [schemaname] RESTRICT

    I get the error:

    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0478N DROP or REVOKE on object type "SCHEMA" cannot be processed because
    there is an object "GIRS.ABBREVIATION", of type "TABLE", which depends on it.
    SQLSTATE=42893

    Is there no way in db2 to drop a user and all of their objects?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •