Thanks Bex. I've been playing with Magic Nodes. Very cool.
I had everything working in Access but I get errors moving into Magic Nodes.
Here's what I have:
First, a query saved in the database as DupContent (Same as you suggested to the "-me" poster above):
Code: Select all
SELECT Songs.SignPart1, Songs.SignPart2, Songs.SignPart3, Songs.SignPart4, Count(Songs.ID) AS CountOfID
FROM Songs
GROUP BY Songs.SignPart1, Songs.SignPart2, Songs.SignPart3, Songs.SignPart4
HAVING (((Count(Songs.ID))>1));
Then a query of Songs matching a certain path, joined to DupContent on the SignPart fields, with a correlated "EXISTS" subquery that makes sure at least one dup of the song exists outside of the matched path:
Code: Select all
SELECT ID AS IDToDelete, SongTitle, SongPath
FROM Songs AS S INNER JOIN DupContent ON (S.SignPart1 = DupContent.SignPart1) AND (S.SignPart2 = DupContent.SignPart2) AND (S.SignPart3 = DupContent.SignPart3) AND (S.SignPart4 = DupContent.SignPart4)
WHERE IDMedia = 49
AND SongPath LIKE ":\Documents and Settings\Eric\My Documents\Robs Friends Music\*"
AND EXISTS (
select 'x'
FROM Songs S2
WHERE (S2.SignPart1 = S.SignPart1) AND (S2.SignPart2 = S.SignPart2) AND (S2.SignPart3 = S.SignPart3) AND (S2.SignPart4 = S.SignPart4)
AND (IDMedia<> 49 OR SongPath NOT LIKE ":\Documents and Settings\Eric\My Documents\Robs Friends Music\*")
AND S.ID <> S2.ID);
The above works great inside access and appears to return the right rows.
Then I created the following a magic node:
Code: Select all
DupsToDelete|SQL filter: Songs.ID IN (SELECT IDToDelete FROM DupsToDelete)\<Artist>
But I get this "Too Few Parameters" Error:
Code: Select all
There was a problem querying the database: 07002: [Microsoft][ODBC Microsoft Access Driver] Too Few Parameters. Expected 1.
Looking back through the forum postings got my suspicions pointing at the “LIKE” conditions (either disallowed characters, or perhaps ones that could be escaped, or use of the wrong wildcards [* and ? or % and _]), or changing quote characters (using # instead of ‘).
So, in the pursuit of trying to understand how SQL Filters and LIKEs are supposed to work in Magic Nodes I tried creating the following super simple Magic Node:
Code: Select all
Path2 |SQL filter: Songs.SongPath LIKE 'zzzzzy'
Of course I have no songs with paths containing zzzzzy so I’d expect the node to show no songs. Instead it shows all songs. Same for
So obviously I’m missing something.
Thank you,
onglide (Eric)