Re: SQL trigger question
- From: "Dr.UgoGagliardelli" <do.not.spam.me.please@xxxxxxxxxx>
- Date: Thu, 31 May 2007 20:06:27 +0200
il 31/05/2007 17.06, Scrive Dr.UgoGagliardelli 43932392:
il 31/05/2007 16.41, Scrive Hal 40706744:Should be:On May 31, 7:24 am, Graybeard <graybe...@xxxxxxxxxxxxxx> wrote:You should put padata somewhere, e.g.To add or delete any triggers, you need exclusive access to the
file. Your attempt is waiting for file to be available, then times
out.
Okay I got the trigger added. Then I fired myself to test the
functionality of the trigger, and sure enough, my EID showed up in my
work table just like I wanted it to.
After quickly re-hiring myself I started working on the 2nd trigger,
which is going to disable the ACS user account of anyone who
terminates/resigns/whatever AND has a valid ACS user account. ACS is
just a higher level cover for os/400.
So I wrote a 2nd trigger and it does not work, and this one has me
stumped. PADATA will contain the name of the user ID assigned to an
employee for as/400 access, if they have one. So step one when a
record gets put into the work table via trigger one is to associate
the employee ID number with the as/400 user id(if there is one). Item
2 is to set the active flag to "N" on anyone who has an as/400 account
and has met the conditions defined by the first trigger.
BEGIN ATOMIC
select padata from store.peis480h where pa# = new.em# and patid =
'AS400';
if padata is not null then update store.pacs260 set usract = 'N'
where usrprf = padata;
END
The 2nd line errors out with a "Variable PADATA not defined or not
usable". If I comment out line 2 with a -- the syntax check completes
normally. What am I doing wrong here?
define padata [same type as padata];
declare padata [same type as padata];
select padata into padata from store.peis480h where pa# = new.em# and patid = 'AS400';
Now padata is defined.
--
Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAñejoAlcoolInside
Spaccamaroni andate a cagare/Spammers not welcome/Spammers vão à merda
Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'
.
- References:
- SQL trigger question
- From: Hal
- Re: SQL trigger question
- From: Graybeard
- Re: SQL trigger question
- From: Hal
- Re: SQL trigger question
- From: Dr.UgoGagliardelli
- SQL trigger question
- Prev by Date: Re: SQL trigger question
- Next by Date: Re: SQL trigger question
- Previous by thread: Re: SQL trigger question
- Next by thread: Re: SQL trigger question
- Index(es):
Relevant Pages
|