Subject Re: Help with trigger syntax
Author grip_2ls
Mark

For some reason I cannot get the pre/code html tags to work so I have put the code here:

http://pastebin.com/p3kt7bud

Line 19/25 is the second character of the smtp server.

Thanks for pointing out my lack of security - I will change that now.

Thanks

N
--- In firebird-support@yahoogroups.com, Mark Rotteveel <mark@...> wrote:
>
> On Mon, 31 Oct 2011 15:19:30 -0000, "grip_2ls" <lists@...> wrote:
> > Once again I am struggling with the syntax of a trigger. When I run the
> > following I get the error:
> > Error at line 3: Dynamic SQL ErrorSQL error code = -104Token unknown -
> > line 19, column 25;
> > There isn't even a semi-colon on line 19!
> > Any advice gratefully received.
> > Neil
> > SET TERM ^ ;
> > /* Triggers only will work for SQL triggers */
> > CREATE TRIGGER TRGAIBOOKING_STAGE_HISTORY FOR
> > BOOKING_STAGE_HISTORYACTIVE AFTER INSERT POSITION 0AS
> > DECLARE EMAIL VARCHAR(255); DECLARE DESCRIPTION VARCHAR(50);
> > BEGIN SELECT BST.EMAIL, BST.DESCRIPTION FROM BOOKING_STAGE BST WHERE
> > BST.ID = NEW.STAGEID INTO :email, :description;
> > SELECT SendMail('alerts@...', :email,
> > 'Change of status for booking '||NEW.BOOKINGID,
> > 'Just to let you know that booking '||NEW.BOOKINGID||' has now reached
> > stage '||:description, 'auth.smtp.1and1.co.uk',
> > '25', 'bulk@...',
> > '8Burgess') FROM rdb$database;
> > END ^
> > COMMIT WORK ^SET TERM ;^
>
> Could you post it with a better formatted version of both the error
> message and the query, and indicate what is line 19, column 25?
>
> BTW: It looks like you posted the username and password for the
> mailaccount that can be used for bulk-emailing at your ISP. If that is the
> case you might want to change the password of account bulk@... before
> it gets abused.
>