Subdued "Rename View" Button

What is this:

The mouse is hovering over the subdued 'X>Y' button, and the tooltip is 'Rename View'. What is that?

Cheers,
Russ

Man, that's really hard to see when disabled in dark mode.

I took a peek at the code - I'm guessing it's disabled because the view is a schema other than the one you are logged into.

Oracle only allows renaming views in the current schema.

Yeah, except that I am SYSDBA in that session. Does that not count?

Cheers,
Russ

There are things like that in various apps. I have gotten used to it.

Well, our code isn't checking for that currently. Maybe it should though. Not sure offhand but I can look later.

On the other hand...renaming SYS-owned views? Sounds dicey. :smiley:

It certainly is, but it is not just for SYS views that the button is subdued. It is for any views.

Ok, I just did some testing with this.

The only "rename" command that works for views is:

RENAME old_view_name TO new_view_name;

You cannot specify a schema name with this, even when logged in as SYSDBA.

If I log with SYS (or any other user) as SYSDBA, then the only views I can rename are SYS's views. Toad is showing the icon as disabled when logged with non-sys as SYSDBA but I will fix that.

Rename view is a pretty rare operation that I would probably only do as the owner anyway.

That current schema thing is something I try to avoid though it would probably be a good approach in this case.

Cheers,
Russ

Actually, set current_schema trick doesn't work.

I just tried it and got ORA-03001: unimplemented feature when attempting to rename a view in a schema I just switched to.