Here is my query string: It works fine from the psql
prompt, but fails when I do handle.execute() on it.
SELECT s.id,
cwajga_magic_number((cwajga_product(r.rating) ^ (1 /
1)), MAX(lastplay.lastheard), 10, 1061265038) as magic
INTO TEMP magic_order
FROM song AS s LEFT OUTER JOIN rating AS r ON s.id =
r.song LEFT OUTER JOIN lastplay ON lastplay.song = s.id
WHERE r.name IS NULL or r.name ILIKE 'omega697'
GROUP BY s.id;
SELECT SUM(magic) as total INTO TEMP magic_tot FROM
magic_order;
SELECT id, 100.0*magic/total as percent
FROM magic_order, magic_tot
order by percent DESC;
It gives me the following parser error:
DBI::ProgrammingError: ERROR: parser: parse error at
or near 1 at character 66
I totally don't get that parse error when I input it
directly, though, so I don't know what the heck is
going on.
-Kurt