The following lines contain the word 'select', 'insert', 'update' or 'delete':
x_last_update_date IN DATE,
x_last_updated_by IN NUMBER,
x_last_update_login IN NUMBER
) AS
/*************************************************************
Created By :rareddy
Date Created By :
Purpose : initializing the column values
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_ACCR_DTLS
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;
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');
FND_MESSAGE.SET_NAME('FND','FORM_RECORD_DELETED');
SELECT rowid
FROM igs_or_org_accr_dtls
WHERE org_accr_status = x_org_accr_status
AND org_agency_id = x_org_agency_id
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_accr_dtls
WHERE org_accr_status = x_org_accr_status ;
SELECT rowid
FROM igs_or_org_accr_dtls
WHERE org_agency_id = x_institution_cd ;
SELECT ROWID
FROM IGS_OR_ORG_ACCR_DTLS
WHERE org_structure_id = x_org_unit_cd ;
x_last_update_date IN DATE,
x_last_updated_by IN NUMBER,
x_last_update_login IN NUMBER
) AS
/*************************************************************
Created By : rareddy
Date Created By :
Purpose : before any DML
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_agency_id,
x_org_accr_status,
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_accr_status,
new_references.org_agency_id,
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;
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_AGENCY_ID IN VARCHAR2,
x_ORG_ACCR_STATUS IN VARCHAR2,
x_START_DATE IN DATE,
x_END_DATE IN DATE,
X_MODE in VARCHAR2
) AS
/*************************************************************
Created By : rareddy
Date Created By :
Purpose : for row insertion
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_ACCR_DTLS
where ORG_ACCR_STATUS= X_ORG_ACCR_STATUS
and ORG_AGENCY_ID = X_ORG_AGENCY_ID
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_agency_id=>X_ORG_AGENCY_ID,
x_org_accr_status=>X_ORG_ACCR_STATUS,
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_ACCR_DTLS (
ORG_STRUCTURE_ID
,ORG_STRUCTURE_TYPE
,ORG_AGENCY_ID
,ORG_ACCR_STATUS
,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_AGENCY_ID
,NEW_REFERENCES.ORG_ACCR_STATUS
,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_ACCR_DTLS
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_AGENCY_ID IN VARCHAR2,
x_ORG_ACCR_STATUS IN VARCHAR2,
x_START_DATE IN DATE,
x_END_DATE IN DATE,
X_MODE in VARCHAR2
) AS
/*************************************************************
Created By : rareddy
Date Created By :
Purpose : for the update of a row
Know limitations, enhancements or remarks
Change History
Who When What
kumma 17-may-2002 added all columns to be updated in update statement, Bug # 2378113
(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_agency_id=>X_ORG_AGENCY_ID,
x_org_accr_status=>X_ORG_ACCR_STATUS,
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_ACCR_DTLS set
END_DATE = NEW_REFERENCES.END_DATE,
ORG_AGENCY_ID= NEW_REFERENCES.ORG_AGENCY_ID,
ORG_ACCR_STATUS=NEW_REFERENCES.ORG_ACCR_STATUS,
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;
cursor c1 is select ROWID from IGS_OR_ORG_ACCR_DTLS
where ORG_ACCR_STATUS= X_ORG_ACCR_STATUS
and ORG_AGENCY_ID = X_ORG_AGENCY_ID
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_AGENCY_ID,
X_ORG_ACCR_STATUS,
X_START_DATE,
X_END_DATE,
X_MODE );
UPDATE_ROW (
X_ROWID,
X_ORG_STRUCTURE_ID,
X_ORG_STRUCTURE_TYPE,
X_ORG_AGENCY_ID,
X_ORG_ACCR_STATUS,
X_START_DATE,
X_END_DATE,
X_MODE );
procedure DELETE_ROW (
X_ROWID in VARCHAR2
) AS
/*************************************************************
Created By : rareddy
Date Created By :
Purpose : before and after any delete is made
Know limitations, enhancements or remarks
Change History
Who When What
(reverse chronological order - newest change first)
***************************************************************/
begin
Before_DML (
p_action => 'DELETE',
x_rowid => X_ROWID
);
delete from IGS_OR_ORG_ACCR_DTLS
where ROWID = X_ROWID;
p_action => 'DELETE',
x_rowid => X_ROWID
);
end DELETE_ROW;