On 1 Jan 2011, at 6:48pm, Stephan Hüls wrote:

> "CREATE TRIGGER genre_custom_insert AFTER
> INSERT ON library_genres INSERT INTO genre_custom(genre_id, genre, type)
> VALUES(NEW.genre_id, NEW.genre, (select type from podcasts_custom where
> NEW.genre in (SELECT podcast FROM podcasts_custom)))"

Syntax is more like

CREATE TRIGGER genre_custom_insert AFTER INSERT ON library_genres
  FOR EACH ROW BEGIN\
      INSERT INTO genre_custom(genre_id, genre, type) VALUES (NEW.genre_id, 
NEW.genre, (select type from podcasts_custom where NEW.genre in (SELECT podcast 
FROM podcasts_custom)))
  END

Also I note your INSERT (SELECT (SELECT)) structure.  It appears that you're 
trying to insert a list into a field.  Would this do the right thing even in a 
simple command, let alone a TRIGGER ?  Can you try it as a stand-alone command, 
outside the TRIGGER ?

Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to