Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Which trigger is the more efficient?
Tue, Jul 28 2009 3:49 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Which of these two variants is going to be the more efficient in running?

 DECLARE Zapper SENSITIVE CURSOR FOR ZapperSQL;
 DECLARE txt VARCHAR;

 SET txt = ''SELECT * FROM emReadStatus WHERE emReadStatus._fkEMails = ''+CAST(OLDROW._MsgNo AS VARCHAR);

 PREPARE ZapperSQL FROM txt;
 OPEN Zapper;
 WHILE NOT EOF(Zapper) DO DELETE FROM Zapper;
 END WHILE;


or


EXECUTE IMMEDIATE 'DELETE FROM emReadStatus WHERE emReadStatus._fkEMails = '+CAST(OLDROW._MsgNo AS VARCHAR);



Roy Lambert
Tue, Jul 28 2009 1:21 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Which of these two variants is going to be the more efficient in running?
>>

The second - it has less call overhead.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image