Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Triggers
Tue, Mar 18 2008 4:50 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

I've decided that I'm going to format phone numbers using sql something like

CASE
WHEN SUBSTR(_Switchboard,1,2) = '02' THEN SUBSTR(_Switchboard,1,3)+' '+SUBSTR(_Switchboard,4,4)+' '+SUBSTR(_Switchboard,8,4) +' '+SUBSTR(_Switchboard,12,4)+' '+SUBSTR(_Switchboard,16,9)
WHEN SUBSTR(_Switchboard,1,2) = '07' THEN SUBSTR(_Switchboard,1,2)+' '+SUBSTR(_Switchboard,3,3)+' '+SUBSTR(_Switchboard,6,3) +' '+SUBSTR(_Switchboard,9,3)+' '+SUBSTR(_Switchboard,12,13)
WHEN SUBSTR(_Switchboard,1,4)= '0161' THEN SUBSTR(_Switchboard,1,4)+' '+SUBSTR(_Switchboard,5,3)+' '+SUBSTR(_Switchboard,8,4) +' '+SUBSTR(_Switchboard,12,13)
WHEN SUBSTR(_Switchboard,1,4)= '0121' THEN SUBSTR(_Switchboard,1,4)+' '+SUBSTR(_Switchboard,5,3)+' '+SUBSTR(_Switchboard,8,4) +' '+SUBSTR(_Switchboard,12,13)
WHEN SUBSTR(_Switchboard,1,2) = '01' THEN SUBSTR(_Switchboard,1,5)+' '+SUBSTR(_Switchboard,6,3)+' '+SUBSTR(_Switchboard,9,3) +' '+SUBSTR(_Switchboard,12,13)

WHEN SUBSTR(_Switchboard,1,2) = '+1' THEN  SUBSTR(_Switchboard,1,2)+' '+SUBSTR(_Switchboard,3,3)+' '+SUBSTR(_Switchboard,6,3) +' '+SUBSTR(_Switchboard,9,4)+' '+SUBSTR(_Switchboard,13,12)
WHEN SUBSTR(_Switchboard,1,1) = '+' THEN SUBSTR(_Switchboard,1,3)+' '+SUBSTR(_Switchboard,4,2)+' '+SUBSTR(_Switchboard,6,2) +' '+SUBSTR(_Switchboard,8,2)+' '+SUBSTR(_Switchboard,10,2)+' '+SUBSTR(_Switchboard,12,2)+' '+SUBSTR(_Switchboard,14,11)
END

Do I need this in both a Before Insert & Before Update trigger?

Plus since this will be specific to a field it would be nice to restrict it to that field using [OF <UpdateColumns>] but where do I enter that in the create trigger dialog?

Roy Lambert
Tue, Mar 18 2008 12:05 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Do I need this in both a Before Insert & Before Update trigger? >>

Yes, which means that it might be worthwhile to make it a function that is
callable from within the separate triggers.

<< Plus since this will be specific to a field it would be nice to restrict
it to that field using [OF <UpdateColumns>] but where do I enter that in the
create trigger dialog? >>

Once you change the trigger type to Update, it will add a tab that allows
you to specify the columns.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Mar 18 2008 12:38 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

><< Do I need this in both a Before Insert & Before Update trigger? >>
>
>Yes, which means that it might be worthwhile to make it a function that is
>callable from within the separate triggers.

I was thinking about that - what's the performance overhead? Roughly?

Roy Lambert
Tue, Mar 18 2008 5:43 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I was thinking about that - what's the performance overhead? Roughly? >>

You shouldn't notice it compared to having the code in each trigger.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image