A method and computer system for copying a portion of a database structure
associated with a query are disclosed. The database includes one or more
database objects. The method includes recursively retrieving object
definitions for one or more database objects associated with a query to
produce an ordered set of object definitions. It also includes building a
copy of the database structure using the ordered set of object
definitions.