Re: SQL trigger question
- From: Hal <halatos@xxxxxxxxx>
- Date: 31 May 2007 07:41:47 -0700
On May 31, 7:24 am, Graybeard <graybe...@xxxxxxxxxxxxxx> wrote:
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?
Chris
.
- Follow-Ups:
- Re: SQL trigger question
- From: walker.l2
- Re: SQL trigger question
- From: Dr.UgoGagliardelli
- Re: SQL trigger question
- References:
- SQL trigger question
- From: Hal
- Re: SQL trigger question
- From: Graybeard
- 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
|