The following lines contain the word 'select', 'insert', 'update' or 'delete':
select 1
from iby_instrholder
where ci_hld_type = ownertype
and ci_hld_id = ownerid
and ci_instr_type = instrtype
and ci_instr_id = instrid
and activestatus = 1;
select 1
from iby_instrholder
where 'PAYEE' = ownertype
and ci_hld_id = ownerid
and instrtype = 'BANKACCOUNT'
and activestatus = 1;
** insert the holder and instrument information and mark the status as
** active.
*/
insert into iby_instrholder ( ownertype, ownerid, owneraddressid,instrtype, instrid, activestatus,
last_update_date, last_updated_by, creation_date,
created_by,object_version_number)
values ( i_hld_type, i_hld_id,i_hld_address_id,i_instr_type, i_instr_id, 1,
sysdate, fnd_global.user_id, sysdate,
fnd_global.user_id, 1);
** Procedure: deleteHolderInstr.
** Purpose: marks the record identified by the ownerid, ownertype and
** instrid and instrtype as in inactivated.
*/
procedure deleteHolderInstr(i_ecappid in iby_ecapp.ecappid%type,
i_ownertype in iby_instrholder.ownertype%type,
i_ownerid in iby_instrholder.ownerid%type,
i_instrtype in iby_instrholder.instrtype%type,
i_instrid in iby_instrholder.instrid%type)
is
l_cnt integer;
select count(*) into l_cnt
from iby_trxn_summaries_all ps,
iby_instrholder pih
where ps.payerinstrid = pih.instrid
and pih.ownertype = i_ownertype
and pih.ownerid = i_ownerid
and pih.instrid = i_instrid
and ps.status IN ( C_COMMUNICATION_ERROR,C_REQUEST_PENDING,C_SCHED_IN_PROGRESS,
C_REQUEST_SCHEDULED,C_VOICE_AUTH_REQD );
update iby_instrholder
set activestatus = 0,
last_update_date = sysdate,
last_updated_by = fnd_global.user_id,
last_update_login = fnd_global.login_id
where ownertype = i_ownertype
and ownerid = i_ownerid
and activestatus = 1
and instrid = i_instrid;
update iby_instrholder
set activestatus = 0,
last_update_date = sysdate,
last_updated_by = fnd_global.user_id,
last_update_login = fnd_global.login_id
where ownertype = i_ownertype
and ownerid = i_ownerid
and instrtype = i_instrtype
and activestatus = 1
and instrid = i_instrid;
end deleteHolderInstr;
select instrtype, instrid
from iby_instrholder
where ci_hld_type = ownertype
and activestatus = 1
and ci_hld_id = ownerid;
** Procedure: deleteInstr.
** Purpose: marks the record identified by the ownerid, ownertype and
** instrid as inactivated.
*/
procedure deleteInstr( i_ecappid in iby_ecapp.ecappid%type,
i_ownertype in iby_instrholder.ownertype%type,
i_ownerid in iby_instrholder.ownerid%type,
i_instrid in iby_instrholder.instrid%type)
is
begin
-- we don't care what type of instrment it is, just delete it
deleteHolderInstr(i_ecappid, i_ownertype, i_ownerid, null,
i_instrid);
end deleteInstr;