Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Views Annoyance
Sat, Oct 1 2011 12:22 AMPermanent Link

Adam Brett

Orixa Systems

OK this is my fault, but EDBMgr could respond a bit less nastily:

I had a pair of tables Purchases & Purchaseitems.

In the beginning Purchases contained a field ProductID, because all purchases were of a single product, with the purchase items showing all the farmers.

... then different grades of product arrived, & suddenly 1 purchase needed to be multiple products.

I moved ProductID to purchaseitems & altered all app. code, indexes, etc. with care.

However I forgot that there were about 10 Views based on these tables, all of them referencing ProductID in Purchases.

The thing is that EDBMgr seems to test whether all Views work every time you do anything & if any View is faulty calls an error. Even if you are just opening an unrelated table.

Also the error message says "field ProductID was not found in line X Column Y" ... but it doesn't NAME the place where the error was found! (i.e. the name of the View)

Therefore while any View is faulty it is very hard to use the EDBMgr, and it is fairly hard to locate which of the Views (if you have many) are causing the problem.

It would be better if:

* EDBMgr reported the error including the name of the faulty view / function / procedure (ideally reporting more than 1 error if there were several)

* I would actually prefer it if no error was reported, but EDBMgr had a "test all" option which ran through the Views / functions / procedures & checked they were all OK. Or if the error was reported as a message in the messages panel of the screen rather than as a full-blown exception.
Sat, Oct 1 2011 3:31 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam


>The thing is that EDBMgr seems to test whether all Views work every time you do anything & if any View is faulty calls an error. Even if you are just opening an unrelated table.

I think its more down to when views are opened rather than any specific testing. I can't find it now but I seem to recall that they're opened with the database. Naturally opening a view will generate an error if there is a problem.

>Also the error message says "field ProductID was not found in line X Column Y" ... but it doesn't NAME the place where the error was found! (i.e. the name of the View)
>
>Therefore while any View is faulty it is very hard to use the EDBMgr, and it is fairly hard to locate which of the Views (if you have many) are causing the problem.

Whilst its not a full solution

select * from information.views where definition collate ansi_ci like '%productid%'

You obviously haven't realised EVERYTHING is stored in the catalog and its just a matter of figuring out where it is and how to get to it. Took me a hell of a long time Smiley

>
>It would be better if:
>
>* EDBMgr reported the error including the name of the faulty view / function / procedure (ideally reporting more than 1 error if there were several)

Nah - it would be better if ElevateDB understood what I was doing and made all the necessary changes for me. Preferably by reading my mind so I could avoid the exertion of typing <vbg>

>* I would actually prefer it if no error was reported, but EDBMgr had a "test all" option which ran through the Views / functions / procedures & checked they were all OK. Or if the error was reported as a message in the messages panel of the screen rather than as a full-blown exception.

I like the test all idea, not so sure I like "ignoring" problems frustrating as it is.

Roy Lambert [Team Elevate]
Mon, Oct 3 2011 8:58 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Adam,

<< The thing is that EDBMgr seems to test whether all Views work every time
you do anything & if any View is faulty calls an error. Even if you are just
opening an unrelated table. >>

Actually it's EDB itself that does all of the dependency checking, and this
includes making sure that you modify any views to remove the referenced
column before you actually drop it from the source table.

<< Also the error message says "field ProductID was not found in line X
Column Y" ... but it doesn't NAME the place where the error was found! (i.e.
the name of the View) >>

Which operation were you executing when you go the error - the ALTER
TABLE..DROP COLUMN on the ProductID's source table ?

<< Therefore while any View is faulty it is very hard to use the EDBMgr, and
it is fairly hard to locate which of the Views (if you have many) are
causing the problem. >>

I'll see about correcting this, but for now you can do the following:

1) From the Explorer menu in the EDB Manager, select Object Search
(Ctrl-Alt-O).  Make sure that you have the correct database selected (bottom
right-hand corner of the status bar for the main window).

2) You'll now see an Object Search window.  In the For Value: edit box, type
in ProductID and click on the Search button.  You should now see a list of
every object that references the ProductID column (or any other object named
"ProductID").

--
Tim Young
Elevate Software
www.elevatesoft.com
Mon, Oct 3 2011 10:52 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

>1) From the Explorer menu in the EDB Manager, select Object Search
>(Ctrl-Alt-O). Make sure that you have the correct database selected (bottom
>right-hand corner of the status bar for the main window).
>
>2) You'll now see an Object Search window. In the For Value: edit box, type
>in ProductID and click on the Search button. You should now see a list of
>every object that references the ProductID column (or any other object named
>"ProductID").

Another feature I never realised was there. Note to self - check the menus in EDBManager every so often Smiley

Roy Lambert
Mon, Oct 3 2011 1:47 PMPermanent Link

Adam Brett

Orixa Systems

Dear Tim,

Brilliant feature .... as good as Roy's query on the config db, but in a nice gui. I guess the real problem was that my

ALTER TABLE
DROP COLUMN

query ran fine ... but _then_ reported that having dropped the column there were 10 views I needed to delete before the db stopped throwing exceptions (!).

In this situation it would be brilliant to have prior warning (i.e. "there are views which depend on this column") or a block (i.e. if you try to drop a column which is in an index it just plain refuses, so you can run a DROP INDEX query first).

NOTE TO SELF: When dropping columns first test for dependencies on that column in Views, as well as Indexes/Constraints/Functions/etc.
Tue, Oct 11 2011 2:53 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Adam,

<< Brilliant feature .... as good as Roy's query on the config db, but in a
nice gui. I guess the real problem was that my

ALTER TABLE
DROP COLUMN

query ran fine ... but _then_ reported that having dropped the column there
were 10 views I needed to delete before the db stopped throwing exceptions
(!). >>

You don't need to delete the views, just alter them so that they don't refer
to the dropped column anymore.

<< In this situation it would be brilliant to have prior warning (i.e.
"there are views which depend on this column") or a block (i.e. if you try
to drop a column which is in an index it just plain refuses, so you can run
a DROP INDEX query first). >>

I've thought about making the view dependencies a bit stricter, so I'll have
to double-check the reasoning on why this is not the case.  Views do perform
this type of check for any referenced tables/views or functions, just not
individual columns.

--
Tim Young
Elevate Software
www.elevatesoft.com
Image