简体   繁体   English

远程 Oracle 数据库成功连接到 BIRT 但表不显示

[英]Remote Oracle Database Successfully Connected to BIRT But Tables Are Not Showing

I have connected a remote oracle database by its IP address in BIRT through A VPN network .我通过VPN 网络通过BIRT中的IP 地址连接了远程 oracle 数据库。 It shows the connection successful but tables are not showing just Stored Procedure are showing there.它显示连接成功,但表没有显示,只是存储过程显示在那里。

Is there any solution?有什么解决办法吗? Please help me.请帮我。

Reasons could be:原因可能是:

  • Did you check the "Prefetch all schemas from database" and "Enable SQL code assist" checkboxes in the same JDBC Dataset preferences?您是否检查了同一 JDBC 数据集首选项中的“从数据库中预取所有模式”和“启用 SQL 代码辅助”复选框? I think hat tables are only shown when these are checked.我认为只有在检查这些时才会显示帽子表。

  • What you think is a TABLE is a SYNONYM instead.你认为是一个 TABLE 是一个同义词。 Synonyms are only shown when the "Show Aliases" checkbox in the DataSet edit dialog is checked.仅在选中数据集编辑对话框中的“显示别名”复选框时显示同义词。

  • Or it's a VIEW.或者它是一个视图。 Check the "Type" listbox in the DataSet edit dialog.检查数据集编辑对话框中的“类型”列表框。

Anyway, while developing reports for a schema with about 1000 objects (tables, views, synonyms, packages etc) everyday, I have switched the options "Prefetch all schemas from database" and "Enable SQL code assist" off, and I don't miss it at all.无论如何,在每天为大约 1000 个对象(表、视图、同义词、包等)的模式开发报告时,我已经关闭了“从数据库中预取所有模式”和“启用 SQL 代码辅助”选项,但我没有完全想念它。

Instead, as a best practice:相反,作为最佳实践:

I always develop and test my SQL queries with Oracle SQL*Developer (using bind variables of the form:PI_XXX) and then just copy/paste the query into BIRT's DataSet edit dialog.我总是使用 Oracle SQL*Developer(使用以下形式的绑定变量:PI_XXX)开发和测试我的 SQL 查询,然后将查询复制/粘贴到 BIRT 的数据集编辑对话框中。

Each bind variable exists exactly once in the query.每个绑定变量在查询中只存在一次。 This is strictly necessary, because internally, BIRT/JDBC replaces each:PI_XXX bind variable with a "?".这是绝对必要的,因为在内部,BIRT/JDBC 将 each:PI_XXX 绑定变量替换为“?”。

Each bind variable corresponds to a BIRT DataSet parameter.每个绑定变量对应一个 BIRT DataSet 参数。 The order of the DS parameters must correspond to the order of the bind variables in the query. DS 参数的顺序必须与查询中绑定变量的顺序相对应。

In order to be able to use a bind variable several times in a query, I use the WITH PARAMS AS (SELECT... FROM DUAL) trick:为了能够在查询中多次使用绑定变量,我使用 WITH PARAMS AS (SELECT... FROM DUAL) 技巧:

For example:例如:

with params as
(   select :PI_PATTERN as pattern
         , to_date(:PI_FROM_DATE, 'DD.MM.YYYY')      as from_date_incl
         , to_date(:PI_UNTIL_DATE, 'DD.MM.YYYY') + 1 as until_date_excl
    from dual
)
select t.MY_ID
     , t.ENTRY_DATE
     , t.DESCRIPTION
from   my_table t
     , params
where  (params.pattern is null or t.description like params.pattern)
and    (params.from_date_incl is null or params.from_date_incl <= t.entry_date)
and    (params.until_date_excl is null or t.entry_date < params.until_date_excl)
order by t.MY_ID

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM