---
title: "DBLINK远程从其他实例（库）中获取到值后，给当前过程变量赋值"
author: "vortexchoo"
date: "2014-08-27T13:50:16Z"
tags: []
categories: ["数据库"]
slug: "dblink"
draft: false
lastmod: "2014-08-27T13:50:16Z"
id: 2109517
url: "https://vortexchoo.iteye.com/blog/2109517"
---

由于dblink\_name 是动态获取的所以不能使用

select xxx into xx from table 的写法

改用：

execute immediate 'select to\_char(count(1)) from sys\_employee@"'||dblink\_name||'"' into val\_num;