Recipe 4.7. Blocking Inserts to Certain Columns
Problem
You wish to prevent users, or an errant software application, from inserting values into certain table columns. For example, you wish to allow a program to insert into EMP, but only into the EMPNO, ENAME, and JOB columns.
Solution
Create a view on the table exposing only those columns you wish to expose. Then force all inserts to go through that view.
For example, to create a view exposing the three columns in EMP:
create view new_emps as select empno, ename, job from emp
It is also possible, but perhaps less useful, to insert into an inline view (currently only supported by Oracle):
insert into (select empno, ename, job from emp) values (1, 'Jonathan', 'Editor')
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23895263/viewspace-681055/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Recipe 5.2. Listing a Table's Columns
- Get the characteristics of a certain class for a certain materialAI
- Automatically Map Network Drives on Domain Login for All Users, Certain Users, or Certain GroupsAI
- CSS columnsCSS
- Using Excel to generate Inserts for SQL ServerExcelSQLServer
- 5.編寫recipe
- oracle drop columnsOracle
- blocking_session阻塞BloCSession
- Another excuse is usually to be parajumpers sale certain safetyAI
- CSS3 columnsCSSS3
- MySQL COLUMNS分割槽MySql
- Indexing on Virtual ColumnsIndex
- Deployer recipe中Laravel配置檔案Laravel
- CSS columns 多列布局CSS
- F. Color Rows and Columns
- SQL Server阻塞blocking案例分析SQLServerBloC
- DML操作引起的blocking(一)BloC
- DML操作引起的blocking(二)BloC
- Recipe 4.11. Merging Records
- Recipe 5.6. Using SQL to Generate SQLSQL
- Recipe 6.7. Extracting Initials from a Name
- PostgreSQL DBA(174) - PG 13(Allow inserts to trigger autovacuum)SQL
- Oracle 11G Virtual ColumnsOracle
- sqlserver查詢table,columns資訊SQLServer
- Oracle blocking issue with lock table in exclusive modeOracleBloC
- How to prevent blocking in your SQL Server databaseBloCSQLServerDatabase
- 使用 Recipe 安裝 SAP Commerce CloudCloud
- Recipe 1.10. Returning n Random Recordsrandom
- Recipe 3.1. Stacking One Rowset atop Another
- Poor Performance On Certain Dictionary Queries After Upgrade To 10gORMAI
- CSS columns多列布局瀑布流CSS
- PostgreSQL DBA(53) - PG 12 Generated columnsSQL
- Indexing Mixed-Character Set ColumnsIndex
- 11g_NotNull_Columns_with_Default_ValuesNull
- Cross-Origin Read Blocking (CORB)ROSBloCORB
- v$blocking_quiesce 沒有資料BloCUI
- v$session的blocking_session含義SessionBloC
- Recipe 4.10. Updating with Values from Another Table