The following lines contain the word 'select', 'insert', 'update' or 'delete':
x_last_update_date date;
x_last_updated_by pls_integer;
select STANDARD_ID,
STANDARD_TYPE,
STANDARD_DESC,
DATA_SEEDED,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
CREATED_BY,
CREATION_DATE
into x_standard_id,
x_standard_type,
x_standard_desc,
x_data_seeded,
x_last_update_date,
x_last_updated_by,
x_created_by,
x_creation_date
from ecx_standards_vl
where standard_code = p_standard_code
and standard_type = l_standard_type;
i_last_updated_by pls_integer;
select ecx_standards_s.nextval
into x_standard_id
from dual;
i_last_updated_by :=1;
i_last_updated_by :=0;
/* Call the table handler APIS to insert data into
ecx_standards_b , ecx_standards_tl table */
ECX_STANDARDS_PKG.INSERT_ROW(
X_ROWID => i_rowid,
X_STANDARD_ID => x_standard_id,
X_STANDARD_CODE => p_standard_code,
X_STANDARD_TYPE => l_standard_type,
X_DATA_SEEDED => p_data_seeded,
X_STANDARD_DESC => p_standard_desc,
X_CREATION_DATE => sysdate,
X_CREATED_BY => i_last_updated_by,
X_LAST_UPDATE_DATE => sysdate,
X_LAST_UPDATED_BY => i_last_updated_by,
X_LAST_UPDATE_LOGIN => 0);
Update_Standards API is used to update an existing XML Standard definition in the ECX_Standards table.
This API allows users to update the description and data seeded fields by specifying standard id
**/
procedure update_standard
(
x_return_status Out nocopy pls_integer,
x_msg Out nocopy Varchar2,
p_standard_id In pls_integer,
p_standard_desc In Varchar2,
p_data_seeded In Varchar2,
p_owner In varchar2
)
is
i_last_updated_by pls_integer;
i_last_updated_by :=1;
i_last_updated_by :=0;
update ECX_STANDARDS_B
set DATA_SEEDED = p_data_seeded,
LAST_UPDATED_BY = i_last_updated_by,
LAST_UPDATE_DATE = sysdate
where standard_id = p_standard_id;
x_msg := ecx_debug.getTranslatedMessage('ECX_NO_ROWS_UPDATED',
'p_table', 'ECX_STANDARDS_B', 'p_param_name', 'Document Standard ID','p_param_id',p_standard_id);
update ECX_STANDARDS_TL
set STANDARD_DESC = p_standard_desc,
LAST_UPDATED_BY = i_last_updated_by,
LAST_UPDATE_DATE = sysdate,
source_lang = userenv('LANG')
where standard_id = p_standard_id and
userenv('LANG') in (language, source_lang);
x_msg := ecx_debug.getTranslatedMessage('ECX_NO_ROWS_UPDATED',
'p_table',
'ECX_STANDARDS_TL',
'p_param_name',
'Document Standard ID',
'p_param_id',
p_standard_id);
end update_standard;
Delete_XML_Standard API is used to delete an existing XML Standard definition in the ECX_STANDARDS
table and its attributes. This API allows users to delete the definitions by specifying the standard id.
**/
procedure delete_standard
(
x_return_status Out nocopy pls_integer,
x_msg Out nocopy Varchar2,
p_standard_id In pls_integer
)
is
begin
x_return_status := ECX_UTIL_API.G_NO_ERROR;
delete from ecx_standard_attributes
where standard_id = p_standard_id;
/* Call tbale handler DELETE_ROW for the deletion */
ECX_STANDARDS_PKG.DELETE_ROW(x_standard_id => p_standard_id);
x_msg := ecx_debug.getTranslatedMessage('ECX_NO_ROWS_DELETED',
'p_table',
'ECX_STANDARDS',
'p_param_name',
'Document Standard ID',
'p_param_id',p_standard_id);
end delete_standard;