Скрипт внутри
declare -- Local variables here i integer; l_bid_function_id number; l_app_id number; l_category_id number; l_attachment_function number; l_function_name varchar2(50); l_app_short_name varchar2(50); l_new_category_name varchar2(50); l_new_category_desc varchar2(255); begin l_function_name := 'XXXX_FN_TEST'; l_app_short_name := 'XXXX'; l_new_category_name := 'XXXX_NEW_DOC_CATEGORY'; l_new_category_desc := 'New document category'; select f.function_id into l_bid_function_id from FND_FORM_FUNCTIONS f where f.function_name = l_function_name; select app.application_id into l_app_id from FND_APPLICATION app where app.application_short_name = l_app_short_name; select FND_DOCUMENT_CATEGORIES_S.NEXTVAL into l_category_id from dual; select FND_ATTACHMENT_FUNCTIONS_S.NEXTVAL into l_attachment_function from dual; insert into FND_ATTACHMENT_FUNCTIONS(ATTACHMENT_FUNCTION_ID ,FUNCTION_TYPE ,FUNCTION_ID ,FUNCTION_NAME ,CREATION_DATE ,CREATED_BY ,LAST_UPDATE_DATE ,LAST_UPDATED_BY ,LAST_UPDATE_LOGIN ,APPLICATION_ID ,SESSION_CONTEXT_FIELD ,ENABLED_FLAG) values( l_attachment_function ,'F' ,l_bid_function_id ,l_function_name ,sysdate ,FND_GLOBAL.USER_ID ,sysdate ,FND_GLOBAL.USER_ID ,FND_GLOBAL.LOGIN_ID ,l_app_id ,null ,'Y' ); insert into FND_DOCUMENT_CATEGORIES(CATEGORY_ID ,APPLICATION_ID ,CREATION_DATE ,CREATED_BY ,LAST_UPDATE_DATE ,LAST_UPDATED_BY ,LAST_UPDATE_LOGIN ,NAME ,START_DATE_ACTIVE ,END_DATE_ACTIVE ,ATTRIBUTE_CATEGORY ,DEFAULT_DATATYPE_ID) values (l_category_id ,l_app_id ,sysdate ,FND_GLOBAL.USER_ID ,sysdate ,FND_GLOBAL.USER_ID ,FND_GLOBAL.LOGIN_ID ,l_new_category_name ,trunc(sysdate) ,null ,null ,6 ); insert into FND_DOCUMENT_CATEGORIES_TL(CATEGORY_ID ,LANGUAGE ,NAME ,USER_NAME ,CREATION_DATE ,CREATED_BY ,LAST_UPDATE_DATE ,LAST_UPDATED_BY ,LAST_UPDATE_LOGIN ,APP_SOURCE_VERSION ,SOURCE_LANG ) values (l_category_id ,'US' ,l_new_category_name ,l_new_category_desc ,sysdate ,FND_GLOBAL.USER_ID ,sysdate ,FND_GLOBAL.USER_ID ,FND_GLOBAL.LOGIN_ID ,'<schema><<APPS>>' ,'US' ); insert into FND_DOC_CATEGORY_USAGES(DOC_CATEGORY_USAGE_ID ,CATEGORY_ID ,ATTACHMENT_FUNCTION_ID ,ENABLED_FLAG ,CREATION_DATE ,CREATED_BY ,LAST_UPDATE_DATE ,LAST_UPDATED_BY ,LAST_UPDATE_LOGIN ,FORMAT) values (FND_DOC_CATEGORY_USAGES_S.NEXTVAL ,l_category_id ,l_attachment_function ,'Y' ,sysdate ,FND_GLOBAL.USER_ID ,sysdate ,FND_GLOBAL.USER_ID ,FND_GLOBAL.LOGIN_ID ,null ); commit; end;
Комментариев нет :
Отправить комментарий