[亿信BI4.7] 能在PLSQL里面执行的sql语句在BI中测试不通过可能是什么原因?

4569
9

ysy123 初学数据Lv2

发表于2021-7-14 16:38

悬赏20

已解决

楼主
本帖最后由 ysy123 于 2021-7-14 16:49 编辑


最近看过此主题的会员

18247666780

xiaojun

15835925582

xiaoyangmiemie

ESENSOFT官方技术支持

呢喃

www111

张金满

shaoshl

最佳答案
我建议你排查一下,先单独执行每一个sql.然后在分别执行两表之间得union all.问题很可能出在union all上
9个回答

只看楼主

shaoshl 小试身手Lv3

发表于2021-7-14 17:07

只看该作者

取消 关注该作者的回复

沙发

请提供一下详细报错信息.或者sql

ysy123 初学数据Lv2

发表于2021-7-14 17:16

只看该作者

取消 关注该作者的回复

板凳

shaoshl 发表于 2021-7-14 17:07
请提供一下详细报错信息.或者sql

select d.banktype_name, sum(d.balance)
  from (select banktype_name, (balance / '10000') balance
          from (select '' banktype_name, '' balance
                  from fi_ds_exchange_bill_tab_520000 t
                 where t.rg_code = '520000'
                   and t.is_cz = 0
                   and t.hold5 = 0
                   and t.report_date = '2021-06-30'  
                 group by owner_code, owner_name, report_date
                union all
                select banktype_name, balance
                  from (select a.owner_code,
                               (case
                                 when a.bank_name like '%中信银行%' then
                                  '中信银行'
                                 when a.bank_name like '%中国银行%' then
                                  '中国银行'
                                 when a.bank_name like '%交通银行%' then
                                  '中国交通银行'
                                 when a.bank_name like '%贵州银行%' then
                                  '贵州银行'
                                 when a.bank_name like '%建%行%' then
                                  '中国建设银行'
                                 when a.bank_name like '%农业银行%' then
                                  '中国农业银行'
                                 when a.bank_name like '%工商银行%' then
                                  '中国工商银行'
                                 when a.bank_name like '%招商银行%' then
                                  '招商银行'
                                 when a.bank_name like '%贵阳银行%' then
                                  '贵阳银行'
                                 when a.bank_name like '%兴业银行%' then
                                  '兴业银行'
                                 when a.bank_name like '%邮政储蓄银行%' then
                                  '中国邮政储蓄银行'
                                 when a.bank_name like '%国家开发银行%' then
                                  '国家开发银行'
                                 when a.bank_name like '%浙商银行%' then
                                  '浙商银行'
                                 when a.bank_name like '%浦东发展银行%' then
                                  '浦发银行'
                                 when a.bank_name like '%中国农业发展银行%' then
                                  '中国农业发展银行'
                                 when a.bank_name like '%重庆银行%' then
                                  '重庆银行'
                                 else
                                  a.bank_name
                               end) banktype_name,
                               '0' balance
                          from v_acc_accountapply a
                         where not exists (select 1
                                  from fi_ds_exchange_bill_tab_520000 f
                                 where f.account_no = a.account_no
                                   and f.report_date = '2021-06-30'
                                   and f.rg_code = a.rg_code)
                           and a.rg_code = '520000'
                           and a.IS_CZ = 0
                           and a.HOLD5 = 0)
               
                union all
                select a.banktype_name, balance
                  from (select t.banktype_name, to_char(t.balance) balance
                          from fi_ds_exchange_bill_tab_520000 t
                         where t.rg_code = '520000'
                           and t.is_cz = 0
                           and t.hold5 = 0
                           and t.report_date = '2021-06-30') a
                  left join (select t.banktype_name
                              from fi_ds_exchange_bill_tab_520000 t
                             where t.rg_code = '520000'
                               and t.is_cz = 0
                               and t.hold5 = 0
                               and t.report_date = '2021-06-30'
                             group by banktype_name, report_date) b
                    on a.banktype_name = b.banktype_name)) d
group by banktype_name;

shaoshl 小试身手Lv3

发表于2021-7-14 17:33

只看该作者

取消 关注该作者的回复

地板

在BI中测试,是在哪里测试得?

ysy123 初学数据Lv2

发表于2021-7-14 17:36

只看该作者

取消 关注该作者的回复

5#

shaoshl 发表于 2021-7-14 17:33
在BI中测试,是在哪里测试得?

sql数据源,然后报错测试不通过

shaoshl 小试身手Lv3

发表于2021-7-14 17:37

只看该作者

取消 关注该作者的回复

6#

测试不通过没有任何提示吗?

ysy123 初学数据Lv2

发表于2021-7-14 17:41

只看该作者

取消 关注该作者的回复

7#

shaoshl 发表于 2021-7-14 17:37
测试不通过没有任何提示吗?

没有,就只返回了一个测试不通过,没有错误原因

shaoshl 小试身手Lv3

发表于2021-7-14 16:38

只看该作者

取消 关注该作者的回复

8#

我建议你排查一下,先单独执行每一个sql.然后在分别执行两表之间得union all.问题很可能出在union all上

ysy123 初学数据Lv2

发表于2021-7-15 09:26

只看该作者

取消 关注该作者的回复

9#

shaoshl 发表于 2021-7-14 17:47
我建议你排查一下,先单独执行每一个sql.然后在分别执行两表之间得union all.问题很可能出在union all上 ...

单独执行每一条都可以执行,加上union all就不行,BI里面使用union all有什么需要注意的吗?

shaoshl 小试身手Lv3

发表于2021-7-15 09:48

只看该作者

取消 关注该作者的回复

10#

union all 合并表数据,需要字段类型也是一摸一样得.你可以把有问题得两表union all字段,排错一下.

登录后可回答问题,请登录注册

快速回复 返回顶部 返回列表

小时

全天响应

分钟

快速处理问题

工程师强势助力

明星产品
解决方案
联系合作

400咨询:400-0011-866

技术支持QQ:400-0011-866(工作日9:00-18:00)

产品建议邮箱yixin@esensoft.com

关注我们

扫TA学习更多干货

一对一专家交流

版权所有© 2006-2024 北京亿信华辰软件有限责任公司 京ICP备07017321号 京公网安备11010802016281号