在auth用户下有一表AUTH_ORG_FRAM:
SELECT ORG_ID AS ID_ORGUNIT,
ORG_NAME AS NAME,
ID_PARENTORGUNIT,
ORGCODE,
PARENTORGUNITCODE,
CODE,
FULLNAME,
SORT,
VAILDINT,
ALIAS,
DESCRIPTION,
ID_ORGANIZATION,
ORGUNITNO
FROM AUTH.AUTH_ORG_FRAM;
用auth用户登陆创建视图DD_EFLOW.T_ORGUNIT:
CREATE OR REPLACE VIEW DD_EFLOW.T_ORGUNIT AS
SELECT ORG_ID AS ID_ORGUNIT,
ORG_NAME AS NAME,
ID_PARENTORGUNIT,
ORGCODE,
PARENTORGUNITCODE,
CODE,
FULLNAME,
SORT,
VAILDINT,
ALIAS,
DESCRIPTION,
ID_ORGANIZATION,
ORGUNITNO
FROM AUTH.AUTH_ORG_FRAM;
执行上面的sql时提示"ORA-00942 表或视图不存在",纳闷了,用select * from AUTH.AUTH_ORG_FRAM语句
查询时可以查到数据,但创建视图时就提示找不到,在网上搜索这个问题,有两种情况,第一,大小写是不是
正确,第二,可能是权限的问题,仔细看了一下,大小写没有问题,原来创建的是DD_EFLOW用户下的视图,
所以,重新用DD_EFLOW用户登陆,然后把查询auth用户下表的权限赋给dd_eflw,Ok,成功创建!
grant select on AUTH.AUTH_ORG_FRAM to dd_eflow;
或者是用下面的语句把查询所用表的权限给用户:
grant select any table to dd_eflow;