SQL-Viewer 2.4 [Script] 2009-10-25

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: SQL-Viewer 2.4 [Script] 2009-10-25

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by donector » Sun Mar 01, 2020 11:20 am

hi all

I am using mmw 4.1.26

from reading a thread:
How Do You "Delete" A Portable Device?
http://www.mediamonkey.com/forum/viewtopic.php?t=60662

I installed the SQL-Viewer 2.4 script, which is supposed to work from mm 3 and above

as from above thread it says:
"If you are comfortable using the sql viewer script, you can use this sql statement to identify the device id's
SELECT * FROM Medias "

which is strange as i am looking to delete DEVICES not MEDIAS...
so what happens:

SELECT * FROM Medias " ... actually gives me devices table! ???

can anybody reproduce this?

is this in any way related to this script being quite old ?..

more weird is that attempting to run from either using "medias" or "devices" sometimes gave me the expected results and some others the unexepcted as I mentioned eariler

how silly was I, that eventually (to clean the devices list) run: DELETE FROM Medias WHERE IDMedia <= 100

whereas, logically, I should have used "devices" , I didn't...(as medias seemed to work)
and then i got the the actual "medias" table wiped out (not devices).

and after doing maintenance to the mm db, it mean most of my db was wiped out: the tracks (lucklily i do have som back up from a couple of months ago, though I have not yet relaoded it)

regardless , now when i run "select * from devices" (from the wiped db) it doesnt give the full list of (actual) devices, but just a few (1 to 4)

if i run the same "select * from devices" using another sql manager (SQLiteStudio 3.1)
.. it does return all the devices (being 216)...

if i run "select * from medias" it shows me the same 4 remaining medias (that were not wiped) on both sql managers

but how on the earth the same (devices) query gives me different results (as said above as from using differente engines)???

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by Guest » Fri May 15, 2015 2:36 am

Izzyman12078

The script 'Tagging Inconsistencies' is ready made for this. In the Album Art Nodes Settings of that script, there's an option for 'Many Album Art'.

http://www.mediamonkey.com/forum/viewtopic.php?p=73421

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by Izzyman12078 » Thu May 14, 2015 12:27 pm

Can someone help me with a SQL to find all albums or tracks with say greater than 100 Album Arts associated? Might seem strange but I've been having a problem with MM crashing and support says:
"....we are saying that some of your tracks have 450 album arts associated with a single track, this is not a normal amount of art for just one track and seems to cause the issue. "

They then immediately closed my ticket and offered no further help after I installed the debug version and sent them the logs.

I don't know how that would be possible but I have 50,000 tracks and would like to identify the culprit(s).

Thanks

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by trixmoto » Thu Aug 21, 2014 9:02 am

I give up.

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by chrisjj » Thu Aug 21, 2014 8:31 am

trixmoto wrote:
chrisjj wrote:Not just switch on the first keyword, then?
No.
Yes is suggested by your

1) ... SELECT queries.
2) ... for UPDATE/INSERT/DELETE queries.
chrisjj wrote:Simplest is to accurately label the buttons.
Sorry. Now corrected to "Simplest is to accurately label the button."

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by trixmoto » Thu Aug 21, 2014 8:20 am

chrisjj wrote:Not just switch on the first keyword, then?
No.
chrisjj wrote:Simplest is to accurately label the buttons.
What is misleading about "Run Select Query" - you click this one when you want to run a SELECT query.

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by chrisjj » Wed Aug 20, 2014 7:55 am

trixmoto wrote:With string manipulation it can actually be pretty tricky to work out which is required for a complex SQL statement, and it's far too much work ...
Not just switch on the first keyword, then?
trixmoto wrote:The fact is that the MM API provides two different methods, so it's simplest to have a button for each, and the user (who should know what they're doing)
can make the decision themselves - power to the user!
Well, the user who knows what he is doing is not going to know what the program is doing whilst the program continues to mislead him with the label "Execute DDL/DML Statement".

Simplest is to accurately label the button. That is what is most useful to a user who knows what he is doing.

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by trixmoto » Wed Aug 20, 2014 7:29 am

Yeah, Bex and I talked about that a while ago (probably years ago :-?). With string manipulation it can actually be pretty tricky to work out which is required for a complex SQL statement, and it's far too much work to try and build a tokenizer and all that nonsense just for this. The fact is that the MM API provides two different methods, so it's simplest to have a button for each, and the user (who should know what they're doing) can make the decision themselves - power to the user!

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by chrisjj » Wed Aug 20, 2014 7:23 am

Since SELECT is a DML statement, I was surprised "Execute DDL/DML Statement" failed to execute it.

Thanks for the explanation.

Perhaps it should be the program not the the user that chooses which method to call. The program would then offer a single Execute button, like other SQL tools.

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by trixmoto » Wed Aug 20, 2014 7:08 am

There's two different buttons that work quite differently...

1) "Run Select Query" uses the OpenSQL method and should be used for running SELECT queries.

2) "Execute DDL/DML Statement" uses the ExecSQL method and should be used for UPDATE/INSERT/DELETE queries.

The reason you get the error is because a SELECT query returns data and the ExecSQL method does not allow this.

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by chrisjj » Mon Aug 18, 2014 9:03 am

Odd that Execute... errors on SELECT:

Image

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by Lost_in_space » Mon Aug 12, 2013 1:49 am

Ah, thx. Since i wasnt sure, i gave it a try:
License isnt valid for 4.0. :-( And then it didnt upgrade anyway, neither did it know, where my MM.DB resides, nor my music collection. And it failed to adapt the localisation. So i reverted from a backup to the 3.0 state. Still sitting duck when it comes to my playlist problem. They have all been invalidated since i applied the suggestion from this forum to use UNC for network drives. (Which solved one big problem, but left me with a smaller one: hundreds of carefully maintained playlists basically gone if i do not find a way to programmatically adapt them with the new "location" of the files.
Yes, sucks to be me. ;-)

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by Nova5 » Sun Aug 11, 2013 7:26 am

Lost_in_space wrote:Although I am aware that MM4 is long avail, i stick with MM3, coz i have life-licence for it.
To circumvent the IUnicode-Problem, i want to install SQLViewer, as it looks like that should do it.
Unfortunately, after hours of trying... no luck. I tried from the Admin's Desktop, also from mine with "Run as adminitrator". Everywhere it complains (after several seconds) like "invalid install package" (Message is localized). I even unzipped the mmip file and upped the version numbers to try that. - Did not help.
Can it be related with me using Win7x64 ? And after finally having moved to UNC pathname to avoid losing my DB regularly, since the Audio files reside on a network...
ALL of my Playlists now have invalid entries (basically lost), except if i was allowed to fix that on my own.

What can i do? My Collection is huge (>30,000 files) No way going in by hand!

Any recommendations? Please...

Oh, btw: just for kicks i tried several other mmips from this website and the problem was the same in every case.
But by searching for solutions to this problem, i couldnt find anything, not a single report. That is why i am asking for help now (in 2013!)

Lifetime License gives you full gold function of ANY MM version. So go for 4! Now if you only bought a cheaper MM3 version license.. sucks to be you. ;)

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by Lost_in_space » Sat Aug 10, 2013 11:08 pm

Oops, i forgot to mention: all the addons are actually visible from the extentions dialog. Only i couldnt find an interface to them. Maybe is was while trying to install that, that the error message got generated? And while looking at every Menu, Button, RMB ... Hot to GET THIS PARTY STARTED???

Re: SQL-Viewer 2.4 [Script] 2009-10-25

by Lost_in_space » Sat Aug 10, 2013 10:13 pm

Although I am aware that MM4 is long avail, i stick with MM3, coz i have life-licence for it.
To circumvent the IUnicode-Problem, i want to install SQLViewer, as it looks like that should do it.
Unfortunately, after hours of trying... no luck. I tried from the Admin's Desktop, also from mine with "Run as adminitrator". Everywhere it complains (after several seconds) like "invalid install package" (Message is localized). I even unzipped the mmip file and upped the version numbers to try that. - Did not help.
Can it be related with me using Win7x64 ? And after finally having moved to UNC pathname to avoid losing my DB regularly, since the Audio files reside on a network...
ALL of my Playlists now have invalid entries (basically lost), except if i was allowed to fix that on my own.

What can i do? My Collection is huge (>30,000 files) No way going in by hand!

Any recommendations? Please...

Oh, btw: just for kicks i tried several other mmips from this website and the problem was the same in every case.
But by searching for solutions to this problem, i couldnt find anything, not a single report. That is why i am asking for help now (in 2013!)

Top