Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Dropping a table prevents the view that references the table, from being dropped
Mon, Feb 3 2014 8:13 PMPermanent Link

Barry

If I drop a table that is used in a view, after I drop the table in EDBMgr I will see an error saying the view 'x' references a table that no longer exists, or something to that effect.  That is to be expected. No problem there.

If I then try to drop the view, I will get the same error and I can't drop the view unless I alter the view and remove the reference to the missing table in the view's SQL. I don't see why I have to do this. If I am dropping the view, why is it validating the view definition? The validation seems unnecessary, right?

Barry
Wed, Feb 5 2014 6:01 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Barry,

<< If I then try to drop the view, I will get the same error and I can't
drop the view unless I alter the view and remove the reference to the
missing table in the view's SQL. I don't see why I have to do this. If I am
dropping the view, why is it validating the view definition? The validation
seems unnecessary, right? >>

The core issue is that EDB shouldn't let you drop the table that is included
in the view.  Are you using the latest release ?

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Feb 5 2014 10:48 AMPermanent Link

Barry

"The core issue is that EDB shouldn't let you drop the table that is included
in the view.  Are you using the latest release ?"

I think you're right. In the past whenever I tried to drop a table that was used in a view, I got an error that forced me to drop/change the view first before dropping the table. I don't know why it didn't complain this time around. I'll keep an eye on it to see if it happens again.

I'm using 2.13 B2

Barry
Thu, Feb 6 2014 7:59 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Barry,

<< I think you're right. In the past whenever I tried to drop a table that
was used in a view, I got an error that forced me to drop/change the view
first before dropping the table. I don't know why it didn't complain this
time around. I'll keep an eye on it to see if it happens again. >>

I tried it here, and it definitely issues an error when you try to drop a
table referenced in a view, at least with a simple query.  Was the view
fairly complex with subqueries or derived tables ?

Tim Young
Elevate Software
www.elevatesoft.com

Fri, Feb 7 2014 10:41 AMPermanent Link

Barry

"Tim Young [Elevate Software]" wrote:
>
I tried it here, and it definitely issues an error when you try to drop a
table referenced in a view, at least with a simple query.  Was the view
fairly complex with subqueries or derived tables ?
<

Tim,

The table that was dropped, was referenced in a table join of the view. It wasn't the driving table in the view.

Barry
Mon, Feb 10 2014 8:43 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Barry,

<< The table that was dropped, was referenced in a table join of the view.
It wasn't the driving table in the view. >>

That won't matter, and also works fine here.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Feb 10 2014 10:57 AMPermanent Link

Barry

<< The table that was dropped, was referenced in a table join of the view.
It wasn't the driving table in the view. >>

<That won't matter, and also works fine here.>

I wouldn't worry about it for now. If it happens again I'll take screen shots so I have it better documented.

Barry
Image