Hi Simon, thanks a lot this is working its not working at run time with qdbc (sqlite3 console). The trigger should insert in genre_custom when a genre is synced to genre_library. When this genre is contained in table podcasts_custom the type from this table should be written to type of genre_custom. Best regards, Stephan
2011/1/1 Simon Slavin <[email protected]> > > 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 > _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

