oracle创建pda
时间: 2023-11-09 07:08:40 浏览: 128
创建pda数据库链接的Oracle语句如下:
```
create public database link dblink_name connect to \[username\] identified by \[password\] using '\[ip\]:\[port\]/\[service_name\]';
```
其中,\[username\]是连接数据库的用户名,\[password\]是密码,\[ip\]是数据库服务器的IP地址,\[port\]是数据库服务器的端口号,\[service_name\]是数据库的服务名。请根据实际情况替换这些参数。\[1\]
创建使用视图的语句如下:
```
create or replace view v_service_person as
select syjy as policeid,
(select p.xm from t_sys_person@dblink_name p where p.ryid = pda.syjy) as policename,
pda.gljg as deptid,
(select d.jgmc from t_sys_department d where d.jgid = pda.gljg) as deptname,
r.gpstime as datetime,
r.longtitude,
r.latitude,
r.gpstime,
to_char(sysdate, 'yyyy/mm/dd hh24:mi:ss') as addtime
from t_in_oms_pda@dblink_name pda, t_in_pgps_locateinfo@dblink_name r
where r.deviceid = pda.dwsbbh;
```
请将\[dblink_name\]替换为您创建的数据库链接的名称,并根据实际情况修改视图中的表名和字段名。\[2\]
希望对您有所帮助!
#### 引用[.reference_title]
- *1* *2* *3* [Oracle创建、删除DATABASE LINK](https://blog.csdn.net/superhoy/article/details/78065865)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文