当前位置:网站首页>Kingbasees database administrator's Guide -- 15.3 Management synonyms
Kingbasees database administrator's Guide -- 15.3 Management synonyms
2022-07-21 14:55:00 【Thousands of sails passed by the side of the sunken boat_】
Catalog
15.3.3. stay DML Use synonyms in statements
You can create synonyms 、 Tasks such as using synonyms and deleting synonyms .
It can be a watch 、 View 、 stored procedure , Establish synonyms for database objects such as sequences , You can also create synonyms for synonyms again , You can even create synonyms for a nonexistent object .
Use CREATE SYNONYM Statement to create synonyms .
stay DML In the sentence , Synonyms are used in exactly the same way as base objects .
You can DROP SYNONYM Statement to delete a synonym that is no longer needed .
Parent theme : Manage views 、 Sequences and synonyms
15.3.1. About synonyms
It can be a watch 、 View 、 stored procedure , Establish synonyms for database objects such as sequences , You can also create synonyms for synonyms again , You can even create synonyms for a nonexistent object .
The synonym itself does not contain the data or code in the original object , It just acts as a pointer , Is the alias of the database object . Besides , Synonyms are easy to use , And can reduce the database users SQL The complexity of the statement . Synonyms allow underlying objects to be renamed or moved , But synonyms must be redefined , Synonym based applications can continue to work without modification . You can create synonyms for public and private .
The public synonym is named PUBLIC The special user group of has , Generally by DBA establish , Every user in the database can access it . Private synonyms are contained in the schema of a particular user ( Not public Pattern ), Available only for this user and the grantee of the underlying object . Synonyms themselves do not involve safety , When you grant permission to a synonym object , You are essentially granting permissions to the base object of the synonym .
Parent theme : Management synonyms
15.3.2. Create synonyms
Use CREATE SYNONYM Statement to create synonyms .
When creating synonyms , The underlying schema object does not need to exist , You don't need permission to access the object , You can also create synonyms . The following statement is contained in schm In the pattern tab1 Create a table named public_syn_tab1 Public synonym for :
CREATE PUBLIC SYNONYM public_syn_tab1 FOR schm.tab1;
You can also use with OR REPLACE Clause CREATE SYNONYM Replace an existing synonym definition :
CREATE OR REPLACE PUBLIC SYNONYM public_syn_tab1 FOR schm.tab1;
When creating synonyms, it should be noted that :
Synonyms cannot have the same name as other synonyms in the same pattern , But there can be synonyms with the same name in different modes
Creating a public synonym cannot specify a pattern
Creating private synonyms cannot specify public Pattern
To create a private synonym, you must specify a pattern ( In the current mode, the path is public when )
Parent theme : Management synonyms
15.3.3. stay DML Use synonyms in statements
stay DML In the sentence , Synonyms are used in exactly the same way as base objects .
As long as you are given permission to the base object , You can use private synonyms of other users . for example , You only have student Tabular SELECT jurisdiction ,student Table has a synonym stu, At this time , You can only stu Query synonyms , Instead of using it to insert data . Empathy , If you have the insert permission of the base object , You can use its synonyms to insert .
for example , A name is student A synonym for , The following statement is valid :
INSERT INTO stu VALUES (stu_sequence.CURRVAL, ' Liuens ',18,' Senior high school grade two ',4,'[email protected]',SYSDATE);
Parent theme : Management synonyms
15.3.4. Delete synonyms
You can DROP SYNONYM Statement to delete a synonym that is no longer needed .
If you want to delete public synonyms , You must have DROP PUBLIC SYNONYM System permissions . When deleting private synonyms , Omit PUBLIC keyword ; When deleting public synonyms , Need to include PUBLIC keyword .
for example , The following statement deletes the name syn_test A synonym for :
DROP SYNONYM syn_test;
The following statement deletes the name public_syn Public synonym for :
DROP PUBLIC SYNONYM public_syn;
Parent theme : Management synonyms
边栏推荐
猜你喜欢
Container network: free days, don't buy an apartment and rent it together
当PCB设计师遇到爱情,猜猜他板内的阻抗有多大变化
How much do you know about the real results if you don't calibrate before the test?
Intel汇编语言程序设计学习-第五章 过程-上
据说只有大神才知道这个电容的作用
Web3流量聚合平台Starfish OS,给玩家元宇宙新范式体验
互联网行业的中年危机是35岁这分水岭
Pycharm input cursor suddenly thickens
Asemi rectifier bridge mb10m parameters, mb10m size, mb10m characteristics
上榜 首批获得实体证书的博客专家
随机推荐
Full Stack Development Practical | SSM Framework Integration full tutoriel
leetcode:407. 接雨水 II
算术运算符2(阁瑞钛伦特软件-九耶实训)
【硬件基础4】二极管(原理、特性、类型、电路分析)
揭露 Apache Doris 数据湖分析技术内幕?稀土开发者大会免费报名中!
全棧開發實戰 | SSM框架整合完整教程
金仓数据库KingbaseES数据库管理员指南--17数据库调度概念
【LeetCode】29、 两数相除
When the microstrip line is pulled open for 7h, you feel very stable?
IDEA 导入项目中文注释乱码如何解决
Production and use of static library
根IT创业者的几个绊脚石
云原生如何支撑企业 IT 治理 | 阿里云用户组
[error analysis] grid access
自定義類型:結構體(一)
Asemi rectifier bridge mb10m parameters, mb10m size, mb10m characteristics
Audience analysis and uninstall analysis have been comprehensively upgraded, and HMS core analysis service version 6.6.0 has been updated
当删则删,这种电容本不该出现
Web3流量聚合平台Starfish OS,给玩家元宇宙新范式体验
When a PCB designer meets love, guess how much the impedance in his board changes