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

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by Bex »

Actually, I've read somewhere in the SQLite documentation that "Beatles" doesn't mean exactly the same as 'Beatles' I don't remember the exact difference but if it is a text string you're having then the proper syntax is 'Beatles'. If you're having a ' in your text string simply escape it an extra ' like this: 'Mark O''Connor'
Both syntaxes give the same result but "Beatles" can sometimes be much slower.

LIKE should only be used together with % or _ otherwise = should be used:
LIKE 'Beatles' gives the same result as = 'Beatles'
LIKE '% Beatles' gives both Beatles and The Beatles
= is always much faster than LIKE since it can use indexes which LIKE can't

Lots of great editors in the middle of the page here:
http://www.mediamonkey.com/wiki/index.p ... %26_Tricks
I use Crimson editor since I'm used to it, but it's not as good as the others.
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Owyn
Posts: 2018
Joined: Fri Mar 21, 2008 10:55 am
Location: Canada

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by Owyn »

Thanks for the info.

I will test out the search criteria carefully as the same criteria will also be used on Original Artist and Composer in the script.
Just added a note to my pseudo code to sanitize search string. Not just eliminate prefix.

FYI: Did a quick scan of the editors and decided on:
Notepad++
Programmers Editor
http://www.download.com/Notepad-/3000-2 ... d=10800351
http://notepad-plus.sourceforge.net/uk/site.htm

FOSS, lightweight, and seems to have the basic features I need to munch VBScript code.
Cogito cogito ergo cogito sum. (Ambrose Bierce)
I drink therefore I am. (Monty Python)
Vista 32bit Home Premium SP2 / MM3.2.1.1297 Gold / Last.Fm 1.0.2.22 / IE8
Dell Inspiron 530 (1.8 Core2 / 2GB)
Skin: Vitreous Blue
Scripts: Add/Remove Playstat|Advanced Duplicate Find & Fix|Album Art Tagger|Backup|Batch Art Finder|Calculate Cover Size|Case&Leading Zero Fixer|DB_Audit|DB_Clean|DB_Schema|Event Logger|Genre Finder|Lyricator|Magic Nodes|MM2VLC|Monkey Rok|MusicIP Tagger|PUID Generator|RegExp Find & Replace|Right Click for Scripts|Scriptreloader|SQL Viewer|Stats(Filtered)|Tagging Inconsistencies
Big_Berny
Posts: 1784
Joined: Mon Nov 28, 2005 11:55 am
Location: Switzerland
Contact:

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by Big_Berny »

I also use Notepad++ for my scripts as it works great for VBS-coding.

And I strongly recommend the addon "Function List" which shows the different Functions and Subroutines in a list so that you easily can jump to them in the code. Long sentence... Maybe it's easier to have a look at the screenshot. ;)
ImageImage

EDIT: Sorry for talking off-topic. Didn't saw that the topic is SQL-Viewer.
Last edited by Big_Berny on Mon Oct 20, 2008 5:21 pm, edited 1 time in total.
Image
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP
AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by nynaevelan »

Hi Bex:

I am having trouble with a simple update statement, any idea why it won't work?

Code: Select all

UPDATE Songs SET Lyrics ='' WHERE Lyrics = '[Lyrics Test]'
Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
Owyn
Posts: 2018
Joined: Fri Mar 21, 2008 10:55 am
Location: Canada

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by Owyn »

Big_Berny wrote:EDIT: Sorry for talking off-topic. Didn't saw that the topic is SQL-Viewer.
No problem as far as I am concerned. That was a good tip about the Function Lister plugin.
Cogito cogito ergo cogito sum. (Ambrose Bierce)
I drink therefore I am. (Monty Python)
Vista 32bit Home Premium SP2 / MM3.2.1.1297 Gold / Last.Fm 1.0.2.22 / IE8
Dell Inspiron 530 (1.8 Core2 / 2GB)
Skin: Vitreous Blue
Scripts: Add/Remove Playstat|Advanced Duplicate Find & Fix|Album Art Tagger|Backup|Batch Art Finder|Calculate Cover Size|Case&Leading Zero Fixer|DB_Audit|DB_Clean|DB_Schema|Event Logger|Genre Finder|Lyricator|Magic Nodes|MM2VLC|Monkey Rok|MusicIP Tagger|PUID Generator|RegExp Find & Replace|Right Click for Scripts|Scriptreloader|SQL Viewer|Stats(Filtered)|Tagging Inconsistencies
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by Bex »

nynaevelan wrote:Hi Bex:

I am having trouble with a simple update statement, any idea why it won't work?

Code: Select all

UPDATE Songs SET Lyrics ='' WHERE Lyrics = '[Lyrics Test]'
Nyn
That looks good to me. In what way doesn't it work?
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by nynaevelan »

It doesn't do anything, it flashes for a second but it doesn't update the field.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by Bex »

Then you don't have any lyrics = [Lyrics Test]
What does this give you:

Code: Select all

SELECT ID, SongTitle, Artist, Lyrics FROM Songs WHERE Lyrics = '[Lyrics Test]'
Btw, when you run Update statements (Update, Drop, Insert, etc) use the button "Execute DDL/DML tatement"
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by nynaevelan »

Bex wrote:Then you don't have any lyrics = [Lyrics Test]
What does this give you:

Code: Select all

SELECT ID, SongTitle, Artist, Lyrics FROM Songs WHERE Lyrics = '[Lyrics Test]'
That is working.
Bex wrote:Btw, when you run Update statements (Update, Drop, Insert, etc) use the button "Execute DDL/DML tatement"
This is probably why I wasn't getting anything. As soon as I used the right button, I was getting the results I was expecting. Thanks again... :D :D

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by Bex »

Yeah, I've sen that some DML statements (Data Manipulation Language) works with the SELECT button but always use the other one for these.
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Mizery_Made
Posts: 2283
Joined: Tue Aug 29, 2006 1:09 pm
Location: Kansas City, Missouri, United States

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by Mizery_Made »

Went into Tagging Inconsistencies a little bit ago and realized there were a few tracks that slipped through your earlier Update Playcount statement, Bex. It seems your statement didn't account for tracks which have a playcount, but have no entry in the Played table. TI is showing 8 tracks which have a playcount of 1, that is off by 1, and 3 which show a playcount of 2 with a difference of 2. Got something that would easily do these?
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by Bex »

That's actually another problem (it's the opposite). But install my Add/Remove Playstat Script and use the function "Add Plays". It can create the missing history plays for you. It works on single tracks only so you have to do it eight times.
http://www.mediamonkey.com/forum/viewto ... =2&t=31809
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Owyn
Posts: 2018
Joined: Fri Mar 21, 2008 10:55 am
Location: Canada

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by Owyn »

Bex:
Ludek is raising some issues about whether the SQL Viewer script is stable in 3.1.

See in this beta topic.

I don't think there is a problem, but, you could make a better call than I can.
Cogito cogito ergo cogito sum. (Ambrose Bierce)
I drink therefore I am. (Monty Python)
Vista 32bit Home Premium SP2 / MM3.2.1.1297 Gold / Last.Fm 1.0.2.22 / IE8
Dell Inspiron 530 (1.8 Core2 / 2GB)
Skin: Vitreous Blue
Scripts: Add/Remove Playstat|Advanced Duplicate Find & Fix|Album Art Tagger|Backup|Batch Art Finder|Calculate Cover Size|Case&Leading Zero Fixer|DB_Audit|DB_Clean|DB_Schema|Event Logger|Genre Finder|Lyricator|Magic Nodes|MM2VLC|Monkey Rok|MusicIP Tagger|PUID Generator|RegExp Find & Replace|Right Click for Scripts|Scriptreloader|SQL Viewer|Stats(Filtered)|Tagging Inconsistencies
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by Bex »

Download link fixed! :D
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]

Post by Bex »

Owyn wrote:Bex:
Ludek is raising some issues about whether the SQL Viewer script is stable in 3.1.

See in this beta topic.

I don't think there is a problem, but, you could make a better call than I can.
There is no problem with this script in 3.1 (or in 3.0 for that matter). It simply only does what you tell it to do, just as any other SQL-tool.
I have a look in the other thread...
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Post Reply