oracle - 数据模型出错无法执行,请联系管理员
问题描述
我有一个数据集,其中包含参数按名称、日期和编号排列的列。但是每次我查看数据时都会出现一个错误The data model cannot be executed because of an error, please contact the administrator.
但它只显示消息但没有显示错误的详细信息。我还有一个值列表,因为我将参数的参数类型设置为name
和number
作为menu
将返回的结果number
是基于的,name
因为如果我不基于名称,它将返回 100+对我的用户来说不合适的值。
例如,我对数据集的查询是,
select a.name, a.date, a.type_name, b.number, c.address
from details1 a, details2 b, details3 c
where
a.id = b.id
and b.id = c.id
and a.name = :name
and a.date between :start_date and :end_date
and b.number = :number
值列表查询name
select a.name from details1 a
where a.type_name = 'person'
值列表查询num
select b.number
from details1 a, details2 b
where 1=1
and a.id = b.id
and a.name = :name
解决方案
我不知道 BI Publisher,但是 - 就 Oracle 而言,列名不能是number
. 它是数据类型的保留字:
SQL> create table test (number number);
create table test (number number)
*
ERROR at line 1:
ORA-00904: : invalid identifier
您的查询使用这样的列:
select b.number ...
这是行不通的,除非有人通过将列名括在双引号中来创建这样的表,例如
SQL> create table test ("number" number);
Table created.
SQL> desc test
Name Null? Type
----------------------------------------- -------- ---------------
number NUMBER
SQL>
但是,您每次都必须使用双引号指定这样的列名,注意字母大小写(意思是:如果列创建为“NumBER”,则必须以这种方式引用它。“numBER”或“NUMber " 或 "nUmBeR" 或 "number" 或 "NUMBER" 不起作用)。几个例子:
SQL> insert into test (number) values (1);
insert into test (number) values (1)
*
ERROR at line 1:
ORA-00928: missing SELECT keyword
SQL> insert into test ("NUMber") values (1);
insert into test ("NUMber") values (1)
*
ERROR at line 1:
ORA-00904: "NUMber": invalid identifier
SQL> insert into test ("NUMBER") values (1);
insert into test ("NUMBER") values (1)
*
ERROR at line 1:
ORA-00904: "NUMBER": invalid identifier
SQL> insert into test ("number") values (1);
1 row created.
SQL> select t."number" from test t;
number
----------
1
SQL>
因此,我建议您检查表格描述并尝试您所看到的;也许它很简单
select b."number" ...
如果是这样的话,很明显,因为你能做某事而做某事并不意味着你应该去做。避免这样的事情,永远不要将 Oracle 对象名称括在双引号中,使用默认值。
推荐阅读
- regex - 要忽略的字符串中的 perl 正则表达式
- c - 在 C 中跟踪链表中的头节点
- html - CSS Grid 两列键:值布局
- sas - SAS 宏变量无效的选项名称
- ios - 使用 didSelectRowAt(_:) 在 Swift 中选择错误单元格后突出显示正确答案
- xml - 如何将从一个表中的 XML 提取的字段插入到另一个表中?
- javascript - 如何从由 JavaScript 呈现 html 的表中抓取数据?(理想情况下在 Python 中,但对其他方法开放)
- python - pandas 系列中的矢量化索引 numpy 数组与 pandas 系列中的布尔 numpy 数组
- javascript - 如何将带有对象的元素附加为其中的内容?
- javascript - 如何使用带有 querySelector 的“this”单独删除输入字段