Simon Slavin wrote: > On 15 Jun 2009, at 2:37am, Simon Slavin wrote: > > >> The examples for the error text I've found are all simple text >> strings, for instance >> >> RAISE(ROLLBACK, 'delete on table "foo" violates foreign key constraint >> "fk_foo_id"') >> >> What I want to do is more like >> >> RAISE(ROLLBACK, 'Attempt to delete author '||old.name||' who has >> books.') >> >> but that doesn't work. >> > > No responses to this ? Can someone confirm for me that error messages > from 'RAISE' have to be just pre-assigned text strings and can't be > expressions ? > > Simon. > Simon,
From the parser you can see the allowed raise function syntax. expr ::= RAISE LP raisetype COMMA nm RP Where nm is the error message. The nm nonterminal can be replaced by the following: nm ::= id nm ::= STRING nm ::= JOIN_KW and the id can bereplaced by; id ::= ID id ::= INDEXED So you can see that the parser is basically designed to only accept a STRING at that position, not an expression which is what would be required to allow concatenation and other function calls. I assume that the other possible values (join keyword etc) would be caught and reported as errors. HTH Dennis Cote _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users