ORA-00942:可以从"schema.table"中选择但不是“表格"? [英] ORA-00942: Can select from "schema.table" but not "table"?

查看:91
本文介绍了ORA-00942:可以从"schema.table"中选择但不是“表格"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在执行

select * from brunch

但是,执行时没有这种问题

However, no such problem when executing

select * from joe.brunch

我可以知道这里是什么问题吗?

May i know what is the issue here?

推荐答案

不合格,BRUNCH在当前会话中引用的对象与JOE.BRUNCH不同.您有几种选择可以解决此问题.

Unqualified, BRUNCH refers to a different object than JOE.BRUNCH in your current session. You've got a couple of options to fix that.

  1. 创建公共同义词.这将允许对JOE.BRUNCH表具有特权的任何用户通过查询BRUNCH

  1. Create a public synonym. This will allow any user that has privileges on the JOE.BRUNCH table to access it by querying BRUNCH

创建公共SYNONYM早午餐 对于joe.brunch

CREATE PUBLIC SYNONYM brunch FOR joe.brunch

创建一个私人同义词.这将仅允许当前用户通过查询BRUNCH

Create a private synonym. This will allow just the current user to access the JOE.BRUNCH table by querying BRUNCH

创建SYNONYM早午餐 对于joe.brunch

CREATE SYNONYM brunch FOR joe.brunch

将当前会话的当前架构更改为JOE.这将导致当前会话中的所有不合格引用都解析为JOE模式,而不是当前用户的模式

Change the current schema for the current session to JOE. This will cause all unqualified references in the current session to resolve to the JOE schema rather than to the current user's schema

ALTER SESSION SET current_schema = JOE

ALTER SESSION SET current_schema = JOE

这篇关于ORA-00942:可以从"schema.table"中选择但不是“表格"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆