Thanks a lot for your help. It seems we have a problem with our qdbc
command. Its terminateing a sql command when a ; is detected. With sqlite
console your syntax is working:


hu-intel:/dev/shmem> /fs/sda0/opt/mm/bin/qdbc -dmme "CREATE TRIGGER
genre_custom

_insert AFTER INSERT ON library_genres BEGIN INSERT INTO
genre_custom(genre_id,

genre, type) VALUES(NEW.genre_id, NEW.genre, (select type from
podcasts_custom w

here NEW.genre in (SELECT podcast FROM podcasts_custom))); END"

qdbc: unable to execute - near ";": syntax error



hu-intel:/dev/shmem> slay qdb



hu-intel:/dev/shmem> /target/sqlite3 /mnt/quota/mm/mme

SQLite version 3.6.14.2

Enter ".help" for instructions

Enter SQL statements terminated with a ";"



sqlite> CREATE TRIGGER genre_custom_insert AFTER INSERT ON library_genres
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
podcas

ts_custom))); END;

sqlite> drop trigger genre_custom_insert;

sqlite>





2011/1/3 Jean-Christophe Deschamps <[email protected]>

>
> >hu-intel:/dev/shmem> /fs/sda0/opt/mm/bin/qdbc -dmme "CREATE TRIGGER
> >genre_custom
> >_insert AFTER INSERT ON library_genres BEGIN INSERT INTO
> >genre_custom(genre_id,
> >genre, type) VALUES(NEW.genre_id, NEW.genre, (select type from
> >podcasts_custom w
> >here NEW.genre in (SELECT podcast FROM podcasts_custom)))); END"
>
> Oops, you also need one more closing parenthesis before the semicolumn.
>
> I didn't try but it now looks fine.
>
> _______________________________________________
> 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

Reply via email to