The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE select_row( recinfo IN OUT NOCOPY gl_period_types%ROWTYPE) IS
BEGIN
SELECT *
INTO recinfo
FROM gl_period_types
WHERE period_type = recinfo.period_type;
END SELECT_ROW;
PROCEDURE select_columns(
x_period_type IN OUT NOCOPY VARCHAR2,
x_user_period_type IN OUT NOCOPY VARCHAR2,
x_year_type_in_name IN OUT NOCOPY VARCHAR2,
x_number_per_fiscal_year IN OUT NOCOPY NUMBER) IS
recinfo gl_period_types%ROWTYPE;
select_row(recinfo);
END select_columns;
SELECT 1
FROM GL_PERIOD_TYPES pt
WHERE pt.user_period_type =
check_unique_user_type.x_user_period_type
AND ( x_rowid is NULL
OR pt.rowid <> x_rowid );
SELECT 1
FROM GL_PERIOD_TYPES pt
WHERE pt.period_type =
check_unique_type.x_period_type
AND ( x_rowid is NULL
OR pt.rowid <> x_rowid );
select GL_PERIOD_TYPES_S.NEXTVAL
into x_period_type
from dual;
/* Update only if force_edits is 'Y' or it is seed data */
if ((x_force_edits = 'Y') OR (x_owner = 'SEED')) then
update gl_period_types
set
user_period_type = x_user_period_type,
description = x_description,
last_update_date = sysdate,
last_updated_by = user_id,
last_update_login = 0
where period_type = x_period_type
AND userenv('LANG') =
( SELECT language_code
FROM FND_LANGUAGES
WHERE installed_flag = 'B' );
the creation date for update_row. */
/* bug 2407006: if it is an existing row, use the original
number_per_fiscal_year to update. */
select creation_date,rowid,number_per_fiscal_year
into v_creation_date, v_rowid, v_num_per_fiscal_yr
from gl_period_types
where period_type = x_period_type;
gl_period_types_pkg.UPDATE_ROW(
x_row_id => v_rowid,
x_period_type => x_period_type,
x_number_per_fiscal_year => v_num_per_fiscal_yr,
x_year_type_in_name => x_year_type_in_name,
x_user_period_type => x_user_period_type,
x_description => x_description,
x_attribute1 => x_attribute1,
x_attribute2 => x_attribute2,
x_attribute3 => x_attribute3,
x_attribute4 => x_attribute4,
x_attribute5 => x_attribute5,
x_context => x_context,
x_last_update_date => sysdate,
x_last_updated_by => user_id,
x_last_update_login => 0,
x_creation_date => v_creation_date
);
gl_period_types_pkg.INSERT_ROW(
x_row_id => v_rowid,
x_period_type => x_period_type,
x_number_per_fiscal_year => x_number_per_fiscal_year,
x_year_type_in_name => x_year_type_in_name,
x_user_period_type => x_user_period_type,
x_description => x_description,
x_attribute1 => x_attribute1,
x_attribute2 => x_attribute2,
x_attribute3 => x_attribute3,
x_attribute4 => x_attribute4,
x_attribute5 => x_attribute5,
x_context => x_context,
x_last_update_date => sysdate,
x_last_updated_by => user_id,
x_last_update_login => 0,
x_creation_date => sysdate,
x_created_by => user_id
);
PROCEDURE UPDATE_ROW(
x_row_id in varchar2,
x_period_type in varchar2,
x_number_per_fiscal_year in number,
x_year_type_in_name in varchar2,
x_user_period_type in varchar2,
x_description in varchar2,
x_attribute1 in varchar2,
x_attribute2 in varchar2,
x_attribute3 in varchar2,
x_attribute4 in varchar2,
x_attribute5 in varchar2,
x_context in varchar2,
x_last_update_date in date,
x_last_updated_by in number,
x_last_update_login in number ,
x_creation_date in date
) AS
BEGIN
Update gl_period_types
set period_type = x_period_type,
number_per_fiscal_year = x_number_per_fiscal_year,
year_type_in_name = x_year_type_in_name,
user_period_type = x_user_period_type,
description = x_description,
attribute1 = x_attribute1,
attribute2 = x_attribute2,
attribute3 = x_attribute3,
attribute4 = x_attribute4,
attribute5 = x_attribute5,
context = x_context,
last_update_date = x_last_update_date,
last_updated_by = x_last_updated_by,
last_update_login = x_last_update_login,
creation_date = x_creation_date
where period_type = x_period_type;
END UPDATE_ROW;
PROCEDURE INSERT_ROW(
x_row_id in out NOCOPY varchar2,
x_period_type in varchar2,
x_number_per_fiscal_year in number,
x_year_type_in_name in varchar2,
x_user_period_type in varchar2,
x_description in varchar2,
x_attribute1 in varchar2,
x_attribute2 in varchar2,
x_attribute3 in varchar2,
x_attribute4 in varchar2,
x_attribute5 in varchar2,
x_context in varchar2,
x_last_update_date in date,
x_last_updated_by in number,
x_last_update_login in number ,
x_creation_date in date,
x_created_by in number
)AS
cursor period_type_row is
select rowid
from gl_period_types
where period_type = x_period_type;
INSERT INTO GL_PERIOD_TYPES(
period_type,
number_per_fiscal_year ,
year_type_in_name ,
user_period_type,
period_type_id,
description,
attribute1,
attribute2,
attribute3,
attribute4,
attribute5,
context,
last_update_date,
last_updated_by,
last_update_login ,
creation_date,
created_by )
select
x_period_type,
x_number_per_fiscal_year ,
x_year_type_in_name ,
x_user_period_type ,
gl_period_types_s.nextval,
x_description ,
x_attribute1,
x_attribute2,
x_attribute3,
x_attribute4,
x_attribute5,
x_context,
x_last_update_date ,
x_last_updated_by ,
x_last_update_login,
x_creation_date,
x_created_by
from dual
where not exists
( select null
from gl_period_types B
where B.period_type = x_period_type );
END INSERT_ROW;
procedure checkUpdate(
mReturnValue OUT NOCOPY VARCHAR2
,mPeriodType IN VARCHAR2
,mNumberPerFiscalYear IN VARCHAR2
,mYearTypeInName IN VARCHAR2
)
AS
l_number_per_fiscal_year Number(15) ;
Cursor c1 is select number_per_fiscal_year,
year_type_in_name
from gl_period_types
where period_type = mPeriodType;
End checkUpdate;