Page 2 of 17

Posted: Mon Jan 14, 2008 2:55 pm
by Teknojnky
well, all I actually suggesting is trying to avoid opening a separate app (the text editor) to input the query string

Posted: Mon Jan 14, 2008 2:56 pm
by SpOiLeR
Sooooo helpfull!!! Many thanx for this one...

Posted: Mon Jan 14, 2008 3:33 pm
by trixmoto
I agree, although for complex statements the textfile is obviously essential, it would be nice to have the option of entering a small query in the window itself instead of having to go back to the textfile each time.

Posted: Mon Jan 14, 2008 4:27 pm
by Bex
I'll see what I can do. I don't know when though...

Posted: Tue Jan 15, 2008 11:51 pm
by mp3_monkey
I installed Statement1.sql, in the MediaMonkey/Scripts directory, ran MM , and pressed CTRL+F9 but I got nothing.

Is there another step needed to enable scripts ?? ... this would be my first!

Posted: Wed Jan 16, 2008 4:12 am
by mp3_monkey
okay I foind the missing step ...updating the scripts.ini file to enclude something like this:

[ExecuteSQL]
FileName=SqlViewer.vbs
ProcName=SqlViewer
Order=40
DisplayName=Allows SQL commands...
Description=Allows SQL commands specified in Statement1.sql to be executed
Language=VBScript
ScriptType=0

I now see and can run the script from Tools\Scripts .... but how do I get Control F9 to work?

Posted: Wed Jan 16, 2008 4:16 am
by mp3_monkey
okay found it...Tools\Options\Hotkeys...

Posted: Wed Jan 16, 2008 4:27 am
by RedX
mp3_monkey wrote:okay I foind the missing step ...updating the scripts.ini file to enclude something like this:

[ExecuteSQL]
FileName=SqlViewer.vbs
ProcName=SqlViewer
Order=40
DisplayName=Allows SQL commands...
Description=Allows SQL commands specified in Statement1.sql to be executed
Language=VBScript
ScriptType=0

I now see and can run the script from Tools\Scripts .... but how do I get Control F9 to work?
Why didn't you use the installer?

Posted: Wed Jan 16, 2008 4:48 am
by Bex
mp3_monkey,

IE actually renames the mmip file to zip and make it "unusable". It's sort of fixed now so undo everything you've done. Download and install the script again using the installer. Then it should work as intended.

(Check out Firefox or Opera, they are great alternatives to IE.)

RedX,
That's why...

Posted: Wed Jan 16, 2008 6:47 am
by mp3_monkey
many thanks... installs correctly now.

Syntax question

Posted: Wed Jan 16, 2008 7:12 pm
by mp3_monkey
I want to change IDMedia to 47 for all records.

I tried UPDATE Songs SET IDMedia ='47' in the Statement1.sql file, but it didnt work. (Error is :No SELECT or FROM keyword detected.)

What is the correct syntax??

Posted: Wed Jan 16, 2008 10:27 pm
by Bex
Currently no DML/DDL is supported. It will be when next version of MM is released. In the meantime I recommend SQLite Spy for updates of numerical fields. If you want to update text fields it's best to wait.

Posted: Wed Jan 16, 2008 11:40 pm
by Guest
Hmmm, I so confused!

Throughout this forum, MM3 users are making changes to the database (I assume thru scripts or external editors). How do they do this? eg: http://www.mediamonkey.com/forum/viewtopic.php?t=24988

Would like to start learning.

Posted: Thu Jan 17, 2008 12:15 am
by mp3_monkey
Bex wrote:Currently no DML/DDL is supported. It will be when next version of MM is released. In the meantime I recommend SQLite Spy for updates of numerical fields. If you want to update text fields it's best to wait.

Actually I have, and started off with SQLite Spy and got into problems : http://www.mediamonkey.com/forum/viewtopic.php?t=24951 So then I thought I would check out the scripts..where it is suggested I go back to SQLite Spy ! So I'm not making much progress!

Would like to know what scripts I can use to change IDMedia and SongPath....or what I need to do with SQLite that would enable me to make changes without the unicode error messages.

Numeric field
My 'need' is as follows. I have 4 computers. All are setup identical ( eg C:\users\public\users. Each week they are all synced up so that they each locally have the same music library and the same database. It all works fine except I need to change the mm.db on each machine, each week, to reflect the correct ID Media number. ( I used to do this no problem with an automated update query Access, but cant use it anymore....hence my desire to learn more about scripts or SQLite.

Text field
The need for changes to SongPath is only on some computers where I need to specify a different location for the media files, ie D:\ or E:\ drive instead of C. Again, the automated Access update query used to take care of it for me.

Any guidance would be really appreciated. Love the product , but starting to get frustrated.

Posted: Thu Jan 17, 2008 4:50 am
by mp3_monkey
Bex wrote:In the meantime I recommend SQLite Spy for updates of numerical fields. If you want to update text fields it's best to wait.

For text fields, for now, where I need to globally change SongPath, I can do it manually with Auto Organize Function.

For numeric fields, like IDMedia, you inidcated that updates should work with SQLite Spy....but when I try it, I get the IUNICODE errors. So whats the trick to get updates on numeric flelds to work?