SQL QUERIES

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey.

Moderator: Gurus

SQL QUERIES

Postby Tomster » Tue Jun 19, 2012 4:16 am

Hey,

i'm trying different sql queries, but it seems that most of them are not working. I can select for instance all from Artists

SELECT * FROM ARTISTS

and it works well.

What does not work is the following:

SELECT * FROM ARTISTS WHERE Artist = 'a-ha'

I do need to use LIKE instead?

SELECT * FROM ARTISTS WHERE Artist LIKE 'a-ha'

It does work with the ID in both ways.

SELECT * FROM ARTISTS WHERE ID = 0
SELECT * FROM ARTISTS WHERE ID LIKE 0

The same thing happens to ORDER BY and all stuff regarding not table column 0.

So

SELECT * FROM ARTISTS ORDER BY ID

works,

SELECT * FROM ARTISTS ORDER BY Artist

does not.

So i have no idea why it's all working with column 0 of every table, but not with any other?

I'm using sqlite directly within a general plugin( sllite3.c )
Tomster
 

Re: SQL QUERIES

Postby Guest » Tue Jun 19, 2012 4:21 am

Use this extension:
viewtopic.php?f=2&t=24841
Guest
 

Re: SQL QUERIES

Postby Guest » Tue Jun 19, 2012 4:28 am

How can is use a script extension within a plugin?

Still i need to know why it's not working.
Guest
 

Re: SQL QUERIES

Postby MMuser2011 » Tue Jun 19, 2012 9:26 am

Maybe it is a collation and UNICODE Issue?
Do you get NOTHING as result or wrong entries?
Magic Nodes v4.2 (2011-07-01) Album Art Tagger v4.9 (2011-02-27)
ExternalTools v1.4 (2011-05-09) MusicBrainz NGS + AcoustId Tagger v1.25 (2012-01-29)
Calculate Cover Size v1.5 (2010-05-03) RegExp Find & Replace v4.3 (2011-07-06)
MMuser2011
 
Posts: 525
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: SQL QUERIES

Postby Guest » Tue Jun 19, 2012 9:37 am

Yes that's the case.

I need to use COLLATE NOCASE all over.

How does SQLite3_CreateCollation16() work, that i don't need to send it within my sql queries?
Guest
 

Re: SQL QUERIES

Postby MMuser2011 » Tue Jun 19, 2012 9:49 am

Please login to the forum, otherwise all your posts are labeled with "Guest" :wink:

Unfortunately, I have no idea how to use SQLite3_CreateCollation16(). Everything I know, you already found in this thread viewtopic.php?f=2&t=25637&p=144852 :oops:
Magic Nodes v4.2 (2011-07-01) Album Art Tagger v4.9 (2011-02-27)
ExternalTools v1.4 (2011-05-09) MusicBrainz NGS + AcoustId Tagger v1.25 (2012-01-29)
Calculate Cover Size v1.5 (2010-05-03) RegExp Find & Replace v4.3 (2011-07-06)
MMuser2011
 
Posts: 525
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe


Return to Addons developer forum

Who is online

Users browsing this forum: No registered users and 0 guests