参数变量架构oracle [英] Parameter variable schema oracle

查看:57
本文介绍了参数变量架构oracle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用Oracle的新手.

I'm newbie using Oracle.

我有一个问题:在SQL Server中,我们可以使用:

I have a question: in SQL Server, we can use:

DECLARE DBNAME1 VARCHAR(20)
DECLARE DBNAME2 VARCHAR(20)

SET @DBNAME1 ='TEST_DB'
SET @DBNAME2 ='TEST_DB2'

INSERT INTO @DBNAME1.TABLECORE
    SELECT * 
    FROM @DBNAME2.TABLENONCORE T

在Oracle中的if @DBNAME == Schema中,此脚本的等效功能是什么?

What is the equivalent of this script in if @DBNAME == Schema in Oracle?

推荐答案

我们可以管理它,但可以在dbname2上创建db link:

We can manage it but creating db link on dbname2 :

create public database link dbname2 connect to myschema using 'abc-scan.mycompany.com.tr:1521/dbname2.mycompany.com.tr';

并从dbname1调用以下dml语句:

and calling the following dml statement from dbname1 :

insert into tablecore select * from tablenocore@dbname2;

这篇关于参数变量架构oracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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