|
-
OK!
create or replace trigger tzgprnt_insert_pidm
before insert on tzgprnt
for each row
declare
pidm number;
tran_number number;
begin
begin
select distinct gwsntid_pidm into pidm
from gwsntid
where gwsntid_netid = :new.tzgprnt_netid;
:new.tzgprnt_pidm := pidm;
exception
when no_data_found then
tzgprnt_pidm := null;
end; -- u have to close every begin block
if pidm IS not null then -- add IS --> this is oracle syntax.
begin
select max(tzgprnt_tran_number) +1 into tran_number
from tzgprnt
where tzgprnt_pidm = pidm;
:new.tzgprnt_tran_number := tran_number;
exception
when no_data_found then
:new.tzgprnt_tran_number := 1;
end;
end if;
end;
/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|