The following lines contain the word 'select', 'insert', 'update' or 'delete':
x_last_update_date IN DATE DEFAULT NULL,
x_last_updated_by IN NUMBER DEFAULT NULL,
x_last_update_login IN NUMBER DEFAULT NULL
) AS
/*************************************************************
Created By : sbonam@in
Date Created By : 2000/05/12
Purpose : Populating the new_reference columns to be used by other
Functions
Know limitations, enhancements or remarks
Change History
Who When What
(reverse chronological order - newest change first)
***************************************************************/
CURSOR cur_old_ref_values IS
SELECT *
FROM IGS_OR_ORG_ALT_IDS
WHERE rowid = x_rowid;
IF (cur_old_ref_values%NOTFOUND) AND (p_action NOT IN ('INSERT','VALIDATE_INSERT')) THEN
Close cur_old_ref_values;
Fnd_Message.Set_Name ('FND', 'FORM_RECORD_DELETED');
IF (p_action = 'UPDATE') THEN
new_references.creation_date := old_references.creation_date;
new_references.last_update_date := x_last_update_date;
new_references.last_updated_by := x_last_updated_by;
new_references.last_update_login := x_last_update_login;
inserting into foreign key columns
Know limitations, enhancements or remarks
Change History
Who When What
(reverse chronological order - newest change first)
***************************************************************/
BEGIN
IF (((old_references.org_alternate_id_type = new_references.org_alternate_id_type)) OR
((new_references.org_alternate_id_type IS NULL))) THEN
NULL;
Fnd_Message.Set_Name ('FND','FORM_RECORD_DELETED');
FND_MESSAGE.SET_NAME('FND','FORM_RECORD_DELETED');
FND_MESSAGE.SET_NAME('FND','FORM_RECORD_DELETED');
FND_MESSAGE.SET_NAME('FND','FORM_RECORD_DELETED');
FND_MESSAGE.SET_NAME('FND','FORM_RECORD_DELETED');
SELECT rowid
FROM igs_or_org_alt_ids
WHERE org_alternate_id = x_org_alternate_id
AND org_alternate_id_type = x_org_alternate_id_type
AND org_structure_id = x_org_structure_id
AND org_structure_type = x_org_structure_type
AND start_date = x_start_date
FOR UPDATE NOWAIT;
SELECT rowid
FROM igs_or_org_alt_ids
WHERE org_alternate_id_type = x_org_alternate_id_type ;
SELECT ROWID
FROM IGS_OR_ORG_ALT_IDS
WHERE (
(org_structure_id = x_institution_cd) AND (org_structure_type = 'INSTITUTE')
);
SELECT ROWID
FROM IGS_OR_ORG_ALT_IDS
WHERE (
(org_structure_id = x_org_unit_cd) AND (org_structure_type = 'ORG_UNIT')
);
x_last_update_date IN DATE DEFAULT NULL,
x_last_updated_by IN NUMBER DEFAULT NULL,
x_last_update_login IN NUMBER DEFAULT NULL
) AS
/*************************************************************
Created By : sbonam@in
Date Created By : 2000/05/12
Purpose : This procedure is called before any DML operation
with the DML operation as a parameter. This is
a function that is called from other functions only like
insert_row/add_row etc. This would not be called from Forms directly.
Know limitations, enhancements or remarks
Change History
Who When What
(reverse chronological order - newest change first)
***************************************************************/
BEGIN
Set_Column_Values (
p_action,
x_rowid,
x_org_structure_id,
x_org_structure_type,
x_org_alternate_id_type,
x_org_alternate_id,
x_start_date,
x_end_date,
x_creation_date,
x_created_by,
x_last_update_date,
x_last_updated_by,
x_last_update_login
);
IF (p_action = 'INSERT') THEN
-- Call all the procedures related to Before Insert.
Null;
ELSIF (p_action = 'UPDATE') THEN
-- Call all the procedures related to Before Update.
Null;
ELSIF (p_action = 'DELETE') THEN
-- Call all the procedures related to Before Delete.
Null;
ELSIF (p_action = 'VALIDATE_INSERT') THEN
-- Call all the procedures related to Before Insert.
IF Get_PK_For_Validation (
new_references.org_alternate_id,
new_references.org_alternate_id_type,
new_references.org_structure_id,
new_references.org_structure_type,
new_references.start_date) THEN
Fnd_Message.Set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
ELSIF (p_action = 'VALIDATE_UPDATE') THEN
Check_Constraints;
ELSIF (p_action = 'VALIDATE_DELETE') THEN
Null;
insert_row/add_row etc. This would not be called from Forms directly.
Know limitations, enhancements or remarks
Change History
Who When What
(reverse chronological order - newest change first)
***************************************************************/
BEGIN
l_rowid := x_rowid;
IF (p_action = 'INSERT') THEN
-- Call all the procedures related to After Insert.
Null;
ELSIF (p_action = 'UPDATE') THEN
-- Call all the procedures related to After Update.
Null;
ELSIF (p_action = 'DELETE') THEN
-- Call all the procedures related to After Delete.
Null;
procedure INSERT_ROW (
X_ROWID in out NOCOPY VARCHAR2,
x_ORG_STRUCTURE_ID IN VARCHAR2,
x_ORG_STRUCTURE_TYPE IN VARCHAR2,
x_ORG_ALTERNATE_ID_TYPE IN VARCHAR2,
x_ORG_ALTERNATE_ID IN VARCHAR2,
x_START_DATE IN DATE,
x_END_DATE IN DATE,
X_MODE in VARCHAR2 default 'R'
) AS
/*************************************************************
Created By :
Date Created By : 2000/05/12
Purpose : This procedure is called from Forms during an
insert_row (ON_INSERT) operation. This in turn
calls Before_DML which inturn calls set_columns
and check_parent_existance Know limitations, enhancements or remarks
Change History
Who When What
(reverse chronological order - newest change first)
***************************************************************/
cursor C is select ROWID from IGS_OR_ORG_ALT_IDS
where ORG_ALTERNATE_ID= X_ORG_ALTERNATE_ID
and ORG_ALTERNATE_ID_TYPE = X_ORG_ALTERNATE_ID_TYPE
and ORG_STRUCTURE_ID = X_ORG_STRUCTURE_ID
and ORG_STRUCTURE_TYPE = X_ORG_STRUCTURE_TYPE
and START_DATE = X_START_DATE
;
X_LAST_UPDATE_DATE DATE ;
X_LAST_UPDATED_BY NUMBER ;
X_LAST_UPDATE_LOGIN NUMBER ;
X_LAST_UPDATE_DATE := SYSDATE;
X_LAST_UPDATED_BY := 1;
X_LAST_UPDATE_LOGIN := 0;
X_LAST_UPDATED_BY := FND_GLOBAL.USER_ID;
if X_LAST_UPDATED_BY is NULL then
X_LAST_UPDATED_BY := -1;
X_LAST_UPDATE_LOGIN :=FND_GLOBAL.LOGIN_ID;
if X_LAST_UPDATE_LOGIN is NULL then
X_LAST_UPDATE_LOGIN := -1;
p_action=>'INSERT',
x_rowid=>X_ROWID,
x_org_structure_id=>X_ORG_STRUCTURE_ID,
x_org_structure_type=>X_ORG_STRUCTURE_TYPE,
x_org_alternate_id_type=>X_ORG_ALTERNATE_ID_TYPE,
x_org_alternate_id=>X_ORG_ALTERNATE_ID,
x_start_date=>X_START_DATE,
x_end_date=>X_END_DATE,
x_creation_date=>X_LAST_UPDATE_DATE,
x_created_by=>X_LAST_UPDATED_BY,
x_last_update_date=>X_LAST_UPDATE_DATE,
x_last_updated_by=>X_LAST_UPDATED_BY,
x_last_update_login=>X_LAST_UPDATE_LOGIN);
insert into IGS_OR_ORG_ALT_IDS (
ORG_STRUCTURE_ID
,ORG_STRUCTURE_TYPE
,ORG_ALTERNATE_ID_TYPE
,ORG_ALTERNATE_ID
,START_DATE
,END_DATE
,CREATION_DATE
,CREATED_BY
,LAST_UPDATE_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_LOGIN
) values (
NEW_REFERENCES.ORG_STRUCTURE_ID
,NEW_REFERENCES.ORG_STRUCTURE_TYPE
,NEW_REFERENCES.ORG_ALTERNATE_ID_TYPE
,NEW_REFERENCES.ORG_ALTERNATE_ID
,NEW_REFERENCES.START_DATE
,NEW_REFERENCES.END_DATE
,X_LAST_UPDATE_DATE
,X_LAST_UPDATED_BY
,X_LAST_UPDATE_DATE
,X_LAST_UPDATED_BY
,X_LAST_UPDATE_LOGIN
);
p_action => 'INSERT' ,
x_rowid => X_ROWID );
end INSERT_ROW;
cursor c1 is select
END_DATE
from IGS_OR_ORG_ALT_IDS
where ROWID = X_ROWID
for update nowait;
fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
Procedure UPDATE_ROW (
X_ROWID in VARCHAR2,
x_ORG_STRUCTURE_ID IN VARCHAR2,
x_ORG_STRUCTURE_TYPE IN VARCHAR2,
x_ORG_ALTERNATE_ID_TYPE IN VARCHAR2,
x_ORG_ALTERNATE_ID IN VARCHAR2,
x_START_DATE IN DATE,
x_END_DATE IN DATE,
X_MODE in VARCHAR2 default 'R'
) AS
/*************************************************************
Created By : sbonam@in.
Date Created By : 2000/05/12
Purpose : This procedure is called from Forms during an
insert_row (ON_UPDATE) operation. This procedure
checks if there is a row for the given primary key and
if there isn't one then inserts it.
Know limitations, enhancements or remarks
Change History
Who When What
(reverse chronological order - newest change first)
***************************************************************/
X_LAST_UPDATE_DATE DATE ;
X_LAST_UPDATED_BY NUMBER ;
X_LAST_UPDATE_LOGIN NUMBER ;
X_LAST_UPDATE_DATE := SYSDATE;
X_LAST_UPDATED_BY := 1;
X_LAST_UPDATE_LOGIN := 0;
X_LAST_UPDATED_BY := FND_GLOBAL.USER_ID;
if X_LAST_UPDATED_BY is NULL then
X_LAST_UPDATED_BY := -1;
X_LAST_UPDATE_LOGIN :=FND_GLOBAL.LOGIN_ID;
if X_LAST_UPDATE_LOGIN is NULL then
X_LAST_UPDATE_LOGIN := -1;
p_action=>'UPDATE',
x_rowid=>X_ROWID,
x_org_structure_id=>X_ORG_STRUCTURE_ID,
x_org_structure_type=>X_ORG_STRUCTURE_TYPE,
x_org_alternate_id_type=>X_ORG_ALTERNATE_ID_TYPE,
x_org_alternate_id=>X_ORG_ALTERNATE_ID,
x_start_date=>X_START_DATE,
x_end_date=>X_END_DATE,
x_creation_date=>X_LAST_UPDATE_DATE,
x_created_by=>X_LAST_UPDATED_BY,
x_last_update_date=>X_LAST_UPDATE_DATE,
x_last_updated_by=>X_LAST_UPDATED_BY,
x_last_update_login=>X_LAST_UPDATE_LOGIN);
update IGS_OR_ORG_ALT_IDS set
END_DATE = NEW_REFERENCES.END_DATE,
LAST_UPDATE_DATE = X_LAST_UPDATE_DATE,
LAST_UPDATED_BY = X_LAST_UPDATED_BY,
LAST_UPDATE_LOGIN = X_LAST_UPDATE_LOGIN
where ROWID = X_ROWID;
p_action => 'UPDATE' ,
x_rowid => X_ROWID
);
end UPDATE_ROW;
insert_row (ON_INSERT) operation. This procedure
checks if there is a row for the given primary key and
if there isn't one then inserts it.
Know limitations, enhancements or remarks
Change History
Who When What
(reverse chronological order - newest change first)
***************************************************************/
cursor c1 is select ROWID from IGS_OR_ORG_ALT_IDS
where ORG_ALTERNATE_ID= X_ORG_ALTERNATE_ID
and ORG_ALTERNATE_ID_TYPE = X_ORG_ALTERNATE_ID_TYPE
and ORG_STRUCTURE_ID = X_ORG_STRUCTURE_ID
and ORG_STRUCTURE_TYPE = X_ORG_STRUCTURE_TYPE
and START_DATE = X_START_DATE
;
INSERT_ROW (
X_ROWID,
X_ORG_STRUCTURE_ID,
X_ORG_STRUCTURE_TYPE,
X_ORG_ALTERNATE_ID_TYPE,
X_ORG_ALTERNATE_ID,
X_START_DATE,
X_END_DATE,
X_MODE );
UPDATE_ROW (
X_ROWID,
X_ORG_STRUCTURE_ID,
X_ORG_STRUCTURE_TYPE,
X_ORG_ALTERNATE_ID_TYPE,
X_ORG_ALTERNATE_ID,
X_START_DATE,
X_END_DATE,
X_MODE );
PROCEDURE DELETE_ROW (
X_ROWID in VARCHAR2
) AS
/*************************************************************
Created By : sbonam@in
Date Created By : 2000/05/12
Purpose : This procedure is called from Forms during an
delete_row (ON_DELETE) operation.
Know limitations, enhancements or remarks
Change History
Who When What
skpandey 28-MAR-2006 Bug#:3634881, RECORD ALREADY EXISTS WHEN INSERTING A NEW ORG ALTERNATE ID, DUPLICATE AT INST
(reverse chronological order - newest change first)
***************************************************************/
--Check Duplicate record and then delete
CURSOR cur_get_rowid(cp_org_alt_id_typ igs_or_cwlk_dtl.alt_id_type%TYPE, cp_alt_id_val igs_or_cwlk_dtl.alt_id_value%TYPE, cp_rowid ROWID) IS
SELECT rowid
FROM igs_or_cwlk_dtl
WHERE alt_id_type = cp_org_alt_id_typ
AND alt_id_value = cp_alt_id_val
AND NOT EXISTS ( SELECT 1
FROM igs_or_org_alt_ids
WHERE org_alternate_id_type = alt_id_type
AND org_alternate_id = alt_id_value
AND rowid <> cp_rowid);
p_action => 'DELETE',
x_rowid => X_ROWID
);
delete from IGS_OR_ORG_ALT_IDS
where ROWID = X_ROWID;
p_action => 'DELETE',
x_rowid => X_ROWID
);
igs_or_cwlk_dtl_pkg.delete_row(x_rowid => l_row_id);
END DELETE_ROW;