RE: Change ownership of tables?
Posted in 2005
> -----Original Message----- > From: owner-informix-list@iiug.org > [mailto:owner-informix-list@iiug.org] On Behalf Of Link, David A. > Sent: Thursday, July 21, 2005 7:05 PM > To: Everett Mills; Neil Truby; informix-list@iiug.org > Subject: RE: Change ownership of tables? > > > Everett, > > Neil was asking about if there was a way without exporting > it. You should be able to just issue a rename table statement > from what I see in the Guide to SQL - Reference... See the > example below.... > > RENAME TABLE > Use the RENAME TABLE statement to change the name of a table. > Syntax Usage To rename a table, you must be the owner of the > table, or have the ALTER privilege on the table, or have the > DBA privilege on the database. An error occurs if old_table > is a synonym, rather than the name of a table. You cannot > change the table owner by renaming the table. An error occurs > if you try to specify an owner. qualifier for the new name of > the table. ♦ A user with DBA privilege on the database can > change the owner of a table, if the table is local. Both the > table name and owner can be changed using one command. The > following example uses the RENAME TABLE statement to change > the owner of a table: RENAME TABLE tro.customer TO > mike.customer When the table owner is changed, you must > specify both the old owner and new owner. > + > Element Purpose Restrictions Syntax > new_table New name for old_table Cannot include an owner. > qualifier here. Identifier, p. 4-189 old_table Name that > new_table replaces Must be the name (not the synonym) of a > table that exists in the current database. Identifier, p. > 4-189 owner Current owner of the table Must be the owner of > the table. Owner, p. 4-234 new_owner The new owner of the > table Must have DBA privilege on the database > (XPS) > Owner, p. 4-234 > old_table TO RENAME TABLE new_table > owner This only works on XPS. So far as I know, in IDS, there is no way to change the owner of a table without building a new table (perhaps 10 added this feature? I haven't looked). DC sending to informix-list