当前位置: 首页 > news >正文

购物网站哪个东西便宜质量好百度指数快刷软件

购物网站哪个东西便宜质量好,百度指数快刷软件,东莞天助网的网站,最近做国际网站怎么样Oracle EBS中分类账和法人实体 的关系(有sql语句实例) 2012-12-06 16:05 2822人阅读 评论(0) 收藏 举报分类:Oracle EBS(12) Oracle数据库技术(6) 版权声明:本文为博主原创文章&…

 

 

Oracle EBS中分类账和法人实体 的关系(有sql语句实例)

 分类:
Oracle EBS(12)  Oracle数据库技术(6) 

首先,对于EBS中的法人实体和分类账以及OU之间的一个层次关系如下图:

 

其中,对于分类账和法人实体,并不简单是一对多的关系,按照理论上来讲:由于分类账存在辅助分类账,所以一个法人实体除了对应一个主分类账(Primary Ledger)外,还可能存在辅助分类账,但是一个法人实体肯定只对应一个唯一的主分类账,而对于分类账之间是否存在有“主从关系”还不太清楚,有待进一步考证。

而在R12中,要找出他们之间的关系就需要通过一下sql来看了:

 

[c-sharp] view plaincopy
  1. SELECT lg.ledger_id,  
  2.        lg.NAME ledger_name,  
  3.        lg.short_name ledger_short_name,  
  4.        cfgdet.object_id legal_entity_id,  
  5.        le.NAME legal_entity_name,  
  6.        reg.location_id location_id,  
  7.        hrloctl.location_code location_code,  
  8.        hrloctl.description location_description,  
  9.        lg.ledger_category_code,  
  10.        lg.currency_code,  
  11.        lg.chart_of_accounts_id,  
  12.        lg.period_set_name,  
  13.        lg.accounted_period_type,  
  14.        lg.sla_accounting_method_code,  
  15.        lg.sla_accounting_method_type,  
  16.        lg.bal_seg_value_option_code,  
  17.        lg.bal_seg_column_name,  
  18.        lg.bal_seg_value_set_id,  
  19.        cfg.acctg_environment_code,  
  20.        cfg.configuration_id,  
  21.        rs.primary_ledger_id,  
  22.        rs.relationship_enabled_flag  
  23.   FROM gl_ledger_config_details primdet,  
  24.        gl_ledgers               lg,  
  25.        gl_ledger_relationships  rs,  
  26.        gl_ledger_configurations cfg,  
  27.        gl_ledger_config_details cfgdet,  
  28.        xle_entity_profiles      le,  
  29.        xle_registrations        reg,  
  30.        hr_locations_all_tl      hrloctl  
  31.  WHERE rs.application_id = 101  
  32.    AND ((rs.target_ledger_category_code = 'SECONDARY' AND  
  33.        rs.relationship_type_code <> 'NONE') OR  
  34.        (rs.target_ledger_category_code = 'PRIMARY' AND  
  35.        rs.relationship_type_code = 'NONE') OR  
  36.        (rs.target_ledger_category_code = 'ALC' AND  
  37.        rs.relationship_type_code IN ('JOURNAL', 'SUBLEDGER')))  
  38.    AND lg.ledger_id = rs.target_ledger_id  
  39.    AND lg.ledger_category_code = rs.target_ledger_category_code  
  40.    AND nvl(lg.complete_flag, 'Y') = 'Y'  
  41.    AND primdet.object_id = rs.primary_ledger_id  
  42.    AND primdet.object_type_code = 'PRIMARY'  
  43.    AND primdet.setup_step_code = 'NONE'  
  44.    AND cfg.configuration_id = primdet.configuration_id  
  45.    AND cfgdet.configuration_id(+) = cfg.configuration_id  
  46.    AND cfgdet.object_type_code(+) = 'LEGAL_ENTITY'  
  47.    AND le.legal_entity_id(+) = cfgdet.object_id  
  48.    AND reg.source_id(+) = cfgdet.object_id  
  49.    AND reg.source_table(+) = 'XLE_ENTITY_PROFILES'  
  50.    AND reg.identifying_flag(+) = 'Y'  
  51.    AND hrloctl.location_id(+) = reg.location_id  
  52.    AND hrloctl.LANGUAGE(+) = userenv('LANG');  
[c-sharp] view plaincopy
  1. SELECT lg.ledger_id,  
  2.        lg.NAME ledger_name,  
  3.        lg.short_name ledger_short_name,  
  4.        cfgdet.object_id legal_entity_id,  
  5.        le.NAME legal_entity_name,  
  6.        reg.location_id location_id,  
  7.        hrloctl.location_code location_code,  
  8.        hrloctl.description location_description,  
  9.        lg.ledger_category_code,  
  10.        lg.currency_code,  
  11.        lg.chart_of_accounts_id,  
  12.        lg.period_set_name,  
  13.        lg.accounted_period_type,  
  14.        lg.sla_accounting_method_code,  
  15.        lg.sla_accounting_method_type,  
  16.        lg.bal_seg_value_option_code,  
  17.        lg.bal_seg_column_name,  
  18.        lg.bal_seg_value_set_id,  
  19.        cfg.acctg_environment_code,  
  20.        cfg.configuration_id,  
  21.        rs.primary_ledger_id,  
  22.        rs.relationship_enabled_flag  
  23.   FROM gl_ledger_config_details primdet,  
  24.        gl_ledgers               lg,  
  25.        gl_ledger_relationships  rs,  
  26.        gl_ledger_configurations cfg,  
  27.        gl_ledger_config_details cfgdet,  
  28.        xle_entity_profiles      le,  
  29.        xle_registrations        reg,  
  30.        hr_locations_all_tl      hrloctl  
  31.  WHERE rs.application_id = 101  
  32.    AND ((rs.target_ledger_category_code = 'SECONDARY' AND  
  33.        rs.relationship_type_code <> 'NONE') OR  
  34.        (rs.target_ledger_category_code = 'PRIMARY' AND  
  35.        rs.relationship_type_code = 'NONE') OR  
  36.        (rs.target_ledger_category_code = 'ALC' AND  
  37.        rs.relationship_type_code IN ('JOURNAL', 'SUBLEDGER')))  
  38.    AND lg.ledger_id = rs.target_ledger_id  
  39.    AND lg.ledger_category_code = rs.target_ledger_category_code  
  40.    AND nvl(lg.complete_flag, 'Y') = 'Y'  
  41.    AND primdet.object_id = rs.primary_ledger_id  
  42.    AND primdet.object_type_code = 'PRIMARY'  
  43.    AND primdet.setup_step_code = 'NONE'  
  44.    AND cfg.configuration_id = primdet.configuration_id  
  45.    AND cfgdet.configuration_id(+) = cfg.configuration_id  
  46.    AND cfgdet.object_type_code(+) = 'LEGAL_ENTITY'  
  47.    AND le.legal_entity_id(+) = cfgdet.object_id  
  48.    AND reg.source_id(+) = cfgdet.object_id  
  49.    AND reg.source_table(+) = 'XLE_ENTITY_PROFILES'  
  50.    AND reg.identifying_flag(+) = 'Y'  
  51.    AND hrloctl.location_id(+) = reg.location_id  
  52.    AND hrloctl.LANGUAGE(+) = userenv('LANG');  

 

 

 

从数据结果中可以看出,系统中有7个分类账(LEDGER)和5个法人实体(LEGAL_ENTITY),对于TCL_YSP这个法人实体来说,拥有两个分类账,其LEDGER_CATEGORY_CODE分别为PRIMARY和SECONDARY,说明了一个法人实体有一个主分类账,并且可以有辅助分类账,而2041这个分类账,则没有对应的法人实体,但是其LEDGER_CATEGORY_CODE依然为PRIMARY,这说明一个分类账的category_code有可能是事前定义好的,而不是在与法人实体关联的时候才决定的,所以不能确定分类账之间到底有层次关系……

对以上的sql进行精简,也可以得出相应的关系来:

 

[c-sharp] view plaincopy
  1. select lg.ledger_id, --分类帐   
  2.        cfgdet.object_id legal_entity_id, --法人实体       
  3.        lg.currency_code,   
  4.        lg.chart_of_accounts_id,   
  5.        rs.primary_ledger_id   
  6.   from gl_ledger_config_details primdet,   
  7.        gl_ledgers               lg,   
  8.        gl_ledger_relationships  rs,   
  9.        gl_ledger_configurations cfg,   
  10.        gl_ledger_config_details cfgdet   
  11. where rs.application_id = 101  --101为总账GL应用   
  12.    and ((rs.target_ledger_category_code = 'SECONDARY' and   
  13.        rs.relationship_type_code <> 'NONE') or   
  14.        (rs.target_ledger_category_code = 'PRIMARY' and   
  15.        rs.relationship_type_code = 'NONE') or   
  16.        (rs.target_ledger_category_code = 'ALC' and   
  17.        rs.relationship_type_code in ('JOURNAL', 'SUBLEDGER')))   
  18.    and lg.ledger_id = rs.target_ledger_id   
  19.    and lg.ledger_category_code = rs.target_ledger_category_code   
  20.    and nvl(lg.complete_flag, 'Y') = 'Y'   
  21.    and primdet.object_id = rs.primary_ledger_id   
  22.    and primdet.object_type_code = 'PRIMARY'   
  23.    and primdet.setup_step_code = 'NONE'   
  24.    and cfg.configuration_id = primdet.configuration_id   
  25.    and cfgdet.configuration_id(+) = cfg.configuration_id   
  26.    and cfgdet.object_type_code(+) = 'LEGAL_ENTITY';  
[c-sharp] view plaincopy
  1. select lg.ledger_id, --分类帐   
  2.        cfgdet.object_id legal_entity_id, --法人实体       
  3.        lg.currency_code,   
  4.        lg.chart_of_accounts_id,   
  5.        rs.primary_ledger_id   
  6.   from gl_ledger_config_details primdet,   
  7.        gl_ledgers               lg,   
  8.        gl_ledger_relationships  rs,   
  9.        gl_ledger_configurations cfg,   
  10.        gl_ledger_config_details cfgdet   
  11. where rs.application_id = 101  --101为总账GL应用   
  12.    and ((rs.target_ledger_category_code = 'SECONDARY' and   
  13.        rs.relationship_type_code <> 'NONE') or   
  14.        (rs.target_ledger_category_code = 'PRIMARY' and   
  15.        rs.relationship_type_code = 'NONE') or   
  16.        (rs.target_ledger_category_code = 'ALC' and   
  17.        rs.relationship_type_code in ('JOURNAL', 'SUBLEDGER')))   
  18.    and lg.ledger_id = rs.target_ledger_id   
  19.    and lg.ledger_category_code = rs.target_ledger_category_code   
  20.    and nvl(lg.complete_flag, 'Y') = 'Y'   
  21.    and primdet.object_id = rs.primary_ledger_id   
  22.    and primdet.object_type_code = 'PRIMARY'   
  23.    and primdet.setup_step_code = 'NONE'   
  24.    and cfg.configuration_id = primdet.configuration_id   
  25.    and cfgdet.configuration_id(+) = cfg.configuration_id   
  26.    and cfgdet.object_type_code(+) = 'LEGAL_ENTITY';  

 

 

 

转载于:https://www.cnblogs.com/qinshi/p/6272659.html

http://www.lbrq.cn/news/2436463.html

相关文章:

  • 大连公司注册网站推广网站要注意什么
  • 那个网站教我做美食最好海会网络做的网站怎么做优化
  • 企业网站建设成本费用百度一下百度搜索百度
  • 网站怎么建在国外网络营销与传统营销有哪些区别
  • 装修公司网站多少钱网站建设优化哪家公司好
  • 企业网站建设 广州网站怎么弄
  • 党建专栏 文字说明 网站建设南宁整合推广公司
  • 上海建网站多少钱营销型网站建设的公司
  • 网站建设总结报告爱站网seo
  • 最新章节 第一百四十七章 做视频网站seoul是什么意思中文
  • 程序开发外包平台广东企业网站seo报价
  • 美国设计公司排名搜索引擎优化seo应用
  • 高端网站建设搭建单页网站seo如何优化
  • 免费ppt模板在哪里下载桂林seo顾问
  • joomla做的网站网络营销代运营外包公司
  • 外贸网站建设专业自动外链发布工具
  • 贸易网站源码百度seo排名软
  • 课程的网站建设怎么注册自己的网站
  • 晋城企业网站建设公司5118站长网站
  • 众筹网站功能百度识图在线使用一下
  • 做网站一般做几个尺寸微信群推广网站
  • 衡阳做网站ss0734上海seo网站优化软件
  • 德清网站设计谷歌浏览器 免费下载
  • 温州设计集团网站建设百度高级搜索入口
  • 延安市城乡建设局网站seo怎么去优化
  • 网络设计思路百度关键词快速优化
  • 大连做网站哪家好一点2023年9月疫情又开始了吗
  • 电商设计网站有哪些内容建网站的公司排名
  • 上海58同城招聘网最新招聘太原百度快速优化
  • 福州外贸网站建设国内新闻大事20条
  • springboot 升级到3.5.x后knife4j 文档无法识别问题解决
  • 视频、音频录制
  • Taro 网络 API 详解与实用案例
  • 浙江大学PTA程序设计C语言基础编程练习题1-5
  • 网络编程---网络基础知识
  • https正向代理 GoProxy