The following lines contain the word 'select', 'insert', 'update' or 'delete':
select count(1)
into duplicate_count
from ra_customer_relationships
where customer_id = x_customer_id
and status = 'A'
and related_customer_id = x_related_customer_id;
PROCEDURE Insert_Row(X_Rowid IN OUT NOCOPY VARCHAR2,
X_Created_By NUMBER,
X_Creation_Date DATE,
X_Customer_Id NUMBER,
X_Customer_Reciprocal_Flag VARCHAR2,
X_relationship_type VARCHAR2,
X_Last_Updated_By NUMBER,
X_Last_Update_Date DATE,
X_Related_Customer_Id NUMBER,
X_Status VARCHAR2,
X_Comments VARCHAR2,
X_Last_Update_Login NUMBER,
X_Attribute_Category VARCHAR2,
X_Attribute1 VARCHAR2,
X_Attribute2 VARCHAR2,
X_Attribute3 VARCHAR2,
X_Attribute4 VARCHAR2,
X_Attribute5 VARCHAR2,
X_Attribute6 VARCHAR2,
X_Attribute7 VARCHAR2,
X_Attribute8 VARCHAR2,
X_Attribute9 VARCHAR2,
X_Attribute10 VARCHAR2,
X_Attribute11 VARCHAR2,
X_Attribute12 VARCHAR2,
X_Attribute13 VARCHAR2,
X_Attribute14 VARCHAR2,
X_Attribute15 VARCHAR2
) IS
/*
CURSOR C IS SELECT rowid FROM RA_CUSTOMER_RELATIONSHIPS
structure WHERE related_customer_id = X_Related_Customer_Id
AND customer_id = X_Customer_Id;
INSERT INTO RA_CUSTOMER_RELATIONSHIPS(
created_by,
creation_date,
customer_id,
customer_reciprocal_flag,
last_updated_by,
last_update_date,
related_customer_id,
status,
comments,
last_update_login,
relationship_type,
attribute_category,
attribute1,
attribute2,
attribute3,
attribute4,
attribute5,
attribute6,
attribute7,
attribute8,
attribute9,
attribute10,
attribute11,
attribute12,
attribute13,
attribute14,
attribute15
) VALUES (
X_Created_By,
X_Creation_Date,
X_Customer_Id,
X_Customer_Reciprocal_Flag,
X_Last_Updated_By,
X_Last_Update_Date,
X_Related_Customer_Id,
X_Status,
X_Comments,
X_Last_Update_Login,
x_relationship_type,
X_Attribute_Category,
X_Attribute1,
X_Attribute2,
X_Attribute3,
X_Attribute4,
X_Attribute5,
X_Attribute6,
X_Attribute7,
X_Attribute8,
X_Attribute9,
X_Attribute10,
X_Attribute11,
X_Attribute12,
X_Attribute13,
X_Attribute14,
X_Attribute15
);
update ra_customer_relationships
set customer_reciprocal_flag = 'Y'
where customer_ID = x_related_customer_id
and related_customer_id = x_customer_id;
insert into ra_customer_relationships
( related_customer_id,
last_update_date,
last_updated_by,
creation_date,
created_by,
last_update_login,
customer_id,
relationship_type,
comments,
attribute_category,
attribute1,
attribute2,
attribute3,
attribute4,
attribute5,
attribute6,
attribute7,
attribute8,
attribute9,
attribute10,
attribute11,
attribute12,
attribute13,
attribute14,
attribute15,
customer_reciprocal_flag,
status)
values
( x_customer_id,
x_last_update_date,
x_last_updated_by,
x_creation_date,
x_created_by,
x_last_update_login,
x_related_customer_id,
x_relationship_type,
x_comments,
x_attribute_category,
x_attribute1,
x_attribute2,
x_attribute3,
x_attribute4,
x_attribute5,
x_attribute6,
x_attribute7,
x_attribute8,
x_attribute9,
x_attribute10,
x_attribute11,
x_attribute12,
x_attribute13,
x_attribute14,
x_attribute15,
x_customer_reciprocal_flag,
x_status);
END Insert_Row;
SELECT *
FROM RA_CUSTOMER_RELATIONSHIPS
WHERE rowid = X_Rowid
FOR UPDATE of Related_Customer_Id NOWAIT;
FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
PROCEDURE Update_Row(X_Rowid VARCHAR2,
X_Customer_Id NUMBER,
X_Customer_Reciprocal_Flag VARCHAR2,
X_Last_Updated_By NUMBER,
X_Last_Update_Date DATE,
X_Related_Customer_Id NUMBER,
X_Status VARCHAR2,
X_Comments VARCHAR2,
X_Last_Update_Login NUMBER,
X_Attribute_Category VARCHAR2,
X_Attribute1 VARCHAR2,
X_Attribute2 VARCHAR2,
X_Attribute3 VARCHAR2,
X_Attribute4 VARCHAR2,
X_Attribute5 VARCHAR2,
X_Attribute6 VARCHAR2,
X_Attribute7 VARCHAR2,
X_Attribute8 VARCHAR2,
X_Attribute9 VARCHAR2,
X_Attribute10 VARCHAR2,
X_Attribute11 VARCHAR2,
X_Attribute12 VARCHAR2,
X_Attribute13 VARCHAR2,
X_Attribute14 VARCHAR2,
X_Attribute15 VARCHAR2
) IS
BEGIN
null;
UPDATE RA_CUSTOMER_RELATIONSHIPS
SET
customer_id = X_Customer_Id,
customer_reciprocal_flag = X_Customer_Reciprocal_Flag,
last_updated_by = X_Last_Updated_By,
last_update_date = X_Last_Update_Date,
related_customer_id = X_Related_Customer_Id,
status = X_Status,
comments = X_Comments,
last_update_login = X_Last_Update_Login,
attribute_category = X_Attribute_Category,
attribute1 = X_Attribute1,
attribute2 = X_Attribute2,
attribute3 = X_Attribute3,
attribute4 = X_Attribute4,
attribute5 = X_Attribute5,
attribute6 = X_Attribute6,
attribute7 = X_Attribute7,
attribute8 = X_Attribute8,
attribute9 = X_Attribute9,
attribute10 = X_Attribute10,
attribute11 = X_Attribute11,
attribute12 = X_Attribute12,
attribute13 = X_Attribute13,
attribute14 = X_Attribute14,
attribute15 = X_Attribute15
WHERE rowid = X_Rowid;
-- Update the reciprocal relationship.
-- if it exist.
--
update ra_customer_relationships
set customer_reciprocal_flag = decode(x_status,
'I','N',
'A','Y'
)
where customer_id = x_related_customer_id
and related_customer_id = x_customer_id;
END Update_Row;