我有3个表,即Customer_1,属于Schema_1的cust_accts和属于Schema_2的Customer_2。所有表都在同一个数据库中。如何从2个不同模式连接2个表,但在同一个数据库中
我有这样
declare
l_cust_id customer_1.customer_id%type;
begin
select customer_id into l_cust_id
from cust_accts
where
customer_number='';
insert into Customer_2
(
column_1,
column_2,
)
select
d1.column_1,
d1.column_2
from
customer_1 d1
where d1.customer_id=l_cust_id;
commit;
end;
一个SQL查询现在在这里,我的问题是所有我应该把模式名称在这些表的面前,就像这样,所有我必须把schema_1.customer_1。并且请不要将所有必需的db连接,连接都给予访问这些表。
在此先感谢您的答案。
在表格之前引用架构。 – Sathya 2014-09-10 08:18:16
嗨,谢谢,所以在每个地方我都必须参考模式礼仪? – user2647888 2014-09-10 08:22:08
该文档告诉您如何引用[其他模式对象](http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements009.htm#SQLRF51134);和[每个命令的语法](http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_10002.htm#i2126073)都会显示模式的添加位置。也不确定你的意思是关于连接和链接,如果这是在同一个数据库。 – 2014-09-10 08:23:39