时间戳控制-技术说明文档-Oracle EBS技术文档整理_第1页
时间戳控制-技术说明文档-Oracle EBS技术文档整理_第2页
时间戳控制-技术说明文档-Oracle EBS技术文档整理_第3页
时间戳控制-技术说明文档-Oracle EBS技术文档整理_第4页
时间戳控制-技术说明文档-Oracle EBS技术文档整理_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

REFDocTitleOracleERP最佳技术实践REFLastDateMarch20,2013IfSection2>1“DateAuthorVersionChangeReference2015/08/22Zhengyan.CaoDraft1aNoPreviousDocument2015/09/30Rex.HuaUpdateReviewersNamePositionDistributionCopyNo.NameLocationNoteToHolders:Ifyoureceiveanelectroniccopyofthisdocumentandprintitout,pleasewriteyournameontheequivalentofthecoverpage,fordocumentcontrolpurposes.Ifyoureceiveahardcopyofthisdocument,pleasewriteyournameonthefrontcover,fordocumentcontrolpurposes.ContentsTOC\o"2-3"DocumentControl iiPreface 2时间戳控制使用说明 3使用说明 3OpenandClosedIssuesforthisDeliverable 6OpenIssues 6ClosedIssues 6PAGE10Preface在很多场景下我们需要控制全量数据的获取,改全量为增量。比如:EBS和MES集成,EBS定时从MES中获取完工数据,完工数据量巨大,我们不可能每次把全部数据取出来。这个时候我们就考虑一个增量的办法。时间戳为获取增量数据较为常用的方法之一:每次数据处理的时候,把当前时间存储下来,在下次获取数据的时候,只获取上次保存时间点之后(含)的数据即可。时间戳控制使用说明使用说明获取系统当前时间或者与外围系统集成的需要获取对方的系统时间2. 获取时间戳cux_pub_timestamp_control_pub.get_timestamp_datecux_pub_timestamp_control_pub.get_timestamp_date3. 更新时间戳,把当前时间l_sysdate更新上去cux_pub_timestamp_control_pub.update_timestamp_datecux_pub_timestamp_control_pub.update_timestamp_date4. 把获取的时间戳日期作为参数传入,获取数据(此处注意,时间判断一定要大于等于,否则有数据丢失的风险)参考cux_pub_timestamp_control_cess_timestamp_demo进行时间戳的控制内容如下:PROCEDUREPROCEDUREprocess_timestamp_demo(p_init_msg_listINVARCHAR2DEFAULTfnd_api.g_false,p_commitINVARCHAR2DEFAULTfnd_api.g_false,x_return_statusOUTNOCOPYVARCHAR2,x_msg_countOUTNOCOPYNUMBER,x_msg_dataOUTNOCOPYVARCHAR2)ISl_api_nameCONSTANTVARCHAR2(100):='PROCESS_TIMESTAMP_DEMO';l_savepoint_nameCONSTANTVARCHAR2(100):='PROCESS_TIMESTAMP_DEMO_SP';CURSORcur_data(p_timestamp_dateDATE)ISSELECT*FROMfnd_userfuWHERE(fu.last_update_date>=p_timestamp_dateORp_timestamp_dateISNULL)--此处注意,一定要大于等于,否则有数据丢失的风险;l_timestamp_dateDATE;--时间戳l_sysdateDATE;--获取当前时间,与外围系统集成的需要获取对方的系统时间l_tiemstamp_typeVARCHAR2(80):=upper('DEMO');--时间戳类型:快码CUX_PUB_TIMESTAMP_TYPE中定义BEGIN--STARTACTIVITYTOCREATESAVEPOINT,CHECKCOMPATIBILITY--ANDINITIALIZEMESSAGELIST,INCLUDEDEBUGMESSAGEHINTTOENTERAPIx_return_status:=cux_api.start_activity(p_pkg_name=>g_pkg_name,p_api_name=>l_api_name,p_savepoint_name=>l_savepoint_name,p_init_msg_list=>p_init_msg_list);raise_exception(x_return_status);-->>1.0获取系统当前时间或者与外围系统集成的需要获取对方的系统时间l_sysdate:=SYSDATE;/*--对于DBlink,需要用dblink获取对方的系统时间,这个一定要注意SELECTSYSDATEINTOl_sysdateFROMdual@erp_linkto_;*/-->>2.0获取时间戳l_timestamp_date:=cux_pub_timestamp_control_pub.get_timestamp_date(p_tiemstamp_type=>l_tiemstamp_type);-->>3.0更新时间戳,把当前时间l_sysdate更新上去cux_pub_timestamp_control_pub.update_timestamp_date(x_return_status=>x_return_status,x_msg_count=>x_msg_count,x_msg_data=>x_msg_data,p_tiemstamp_type=>l_tiemstamp_type,p_timestamp_date=>l_sysdate);raise_exception(x_return_status);-->>4.0把获取的时间戳日期作为参数传入,获取数据FORrecINcur_data(p_timestamp_date=>l_timestamp_date)LOOP--数据处理NULL;ENDLOOP;x_return_status:=cux_api.end_activity(p_pkg_name=>g_pkg_name,p_api_name=>l_api_name,p_commit=>p_commit,x_msg_count=>x_msg_count,x_msg_data=>x_msg_data);raise_exception(x_return_status);EXCEPTIONWHENfnd_api.g_exc_errorTHENx_return_status:=cux_api.handle_exceptions(p_pkg_name=>g_pkg_name,p_api_name=>l_api_name,p_savepoint_name=>l_savepoint_name,p_exc_name=>cux_api.g_exc_name_error,x_msg_count=>x_msg_count,x_msg_data=>x_msg_data);WHENfnd_api.g_exc_unexpected_errorTHENx_return_status:=cux_api.handle_exceptions(p_pkg_name=>g_pkg_name,p_api_name=>l_api_name,p_savepoint_name=>l_savepoint_name,p_exc_name=>cux_api.g_exc_name_unexp,x_msg_count=>x_msg_count,x_msg_data=>x_msg_data);WHENOTHERSTHENx_return_status:=cux_api.handle_exceptions(p_pkg_name=>g_pkg_name

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论