Re: [firebird-support] Re: Help with trigger syntax

2011-10-31 Thread Mark Rotteveel
On Mon, 31 Oct 2011 15:57:27 -, grip_2ls li...@2ls.com wrote:
 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

I am a bit rusty in my PSQL and trigger code, but as far as I know you can
do SELECT without INTO like you are doing when calling that SendEmail
function (or procedure?).

You probably just need to get rid of the SELECT  FROM RDB$DATABASE
stuff around the SendEmail call, but maybe someone with more knowledge of
PSQL knows more.

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

Looks off to me ;)


Re: [firebird-support] Re: Help with trigger syntax

2011-10-31 Thread Mark Rotteveel
On Mon, 31 Oct 2011 17:06:34 +0100, Mark Rotteveel m...@lawinegevaar.nl
wrote:
 I am a bit rusty in my PSQL and trigger code, but as far as I know you
can
 do SELECT without INTO like you are doing when calling that SendEmail
 function (or procedure?).

Uhm, that should have been '.. you can't do SELECT without INTO'. I really
need to learn to proofread before clicking send.

Mark


RE: [firebird-support] Re: Help with trigger syntax - Email found in subject

2011-10-31 Thread Leyne, Sean


 Thanks for the advise but I don't think that is the issue. If you remove the
 second select statement it compiles and runs fine.

Actually, that is the issue.  

It is the 2nd SELECT which is the problem, so by removing it, you removed the 
problem.

To invoke the SendMail UDF, you should define a dummy variable, and then either:

  SELECT SendMail(...) FROM RDB$Database INTO dummyvar;

OR

  dummyvar = SendMail( ...);


Sean





Re: [firebird-support] Re: Help with trigger syntax

2011-10-31 Thread Helen Borrie
At 07:56 AM 1/11/2011, you wrote:
On 31-10-2011 17:46, grip_2ls wrote:
 Hi Mark

 Thanks for the advise but I don't think that is the issue. If you remove the 
 second select statement it compiles and runs fine.

That was exactly the issue I was pointing out. You are using SELECT 
without INTO to call SendMail. That doesn't work as Sean also pointed out.

Furthermore, invoking that Sendmail procedure as a select procedure is not 
sensible in this environment or any other.  Make it an executable procedure 
and, in the trigger code, call it with EXECUTE PROCEDURE (:var1, :var2, etc.)  
Selectable procedures are intended to return sets and shouldn't be used to 
execute DML.

./heLen