Oracle foreign key cascade deletion and cascade update, oracle key level update
Cascading Deletion
Oracle has three behaviors: no action (similar to RESTRICT), CASCADE, and set null.
The following uses the student-class as an example to describe how to delete Foreign keys i
Comparison between four methods for batch ORACLE update and four methods for oracle update
Software Environment Windows 2000 + ORACLE9i
Hardware environment CPU 1.8G + RAM 512 M
Now we have two tables:
T1 -- large table 10000 T1_FK_ID
T2 -- small table 5000 T2_PK_ID
T1 is associated with the primary key ID of T2.
The
Http://www.cnblogs.com/quanweiru/archive/2012/11/09/2762223.html 1,for update and for update nowait differences: First of all, if only Select,Oracle will not add any lock, that is, Oracle to Select read the data there is no limit, although it is possible that another process is modifying the data in the table, And the
Original: Oracle\ms SQL Server Update Multiple Table association updateA single update UPDATE statement is not able to update multiple tables unless you use triggers to suppress updates. In the update operation of the table, in ma
Differences between ORACLE for update and for update nowaitI. Differences between for update and for update nowaitFirst, Oracle will not apply any locks if it is only select, that is, Oracle
Original source http://bijian1013.iteye.com/blog/1895412 the difference between the for update and for update nowait First of all, if only select, Oracle will not add any locks, that is, Oracle to select There is no limit to the data read, although it is possible that another process is modifying the data in the tab
users cannot update the entire row. Does this mean that for update of columns is meaningless?
It is estimated that many ORACLE students have not thought about this question [There are not many posts on the Internet ]. Now I will explain its functions.
From the operation of a single table, the effects of the above two statements are indeed the same. However, when
Basic Update Statements
The Oracle UPDATE statement processes one or more rows in a table and sets one or more columns to the values of you specify.
Update All records
UPDATE SET
CREATE TABLE Test ASSELECT object_name, Object_t
From: http://blog.163.com/gaofx_hk/blog/static/193999289201172893813254/
Oracle does not have the update from syntax. There are two implementation methods:1. subquery:UpdateSet field 1 = (select field expression from B where ...),Field 2 = (select field expression from B where ...)Where logical expression
Update multiple fields:
Statement 1:
by other transactions, the current lock transaction with the conflict, plus nowait, the current transaction will end will prompt the error and immediately end the statement and no longer wait). 2. The wait clause specifies the number of seconds to wait for another user to release the lock, preventing an indefinite wait. The advantages of the use for UPDATE WAIT clause are as follows:1. Prevent indefinitely waiting for a locked line;2. Allow more cont
Original address: http://www.cnblogs.com/quanweiru/archive/2012/11/09/2762223.html1 . The difference between for update and for update nowait: First of all, if only Select,Oracle will not add any lock, that is, Oracle to Select read the data there is no limit, although it is possible that another process is modifying t
The syntax for implementing update Association update in SQL Server and Oracle is different. You can use inline view (embedded view)In general, sqlserver is simpler. The test example is as follows:
Create Table tmp_a(Cpcode varchar2 (10 ),Sb_ym varchar2 (6 ),Flag char (1));
Create Table tmp_ B(Cpcode varchar2 (10 ),Sb_ym varchar2 (6 ),Flag char (1));
Insert into
expensive thanMergeWay slightly higher. ALTER TABLE TEST2 add constraint Pk_test2 primary key (ID); --/*+ BYPASS_UJVC */ Update (select/*+ bypass_ujvc */a.id aid,a.name aname,b.id bid,b.name bname from test1 a,test2 b where a.id=b.id) t Set aname = Nvl2 (aname,bname,aname); Use parallelism to speed up large volumes of data updates: Merge/*+parallel (test1,4) */into Test1 using Test2 On (test1.id = test2.id) When matched then
In general, we only update a single record, but there are few batch updates. Currently, we provide three methods for batch update:
1. Batch update
Update test a set a. dept_no = (select B. dept_no from test1 B where a. emp_no = B. emp_no)
2. Batch update with multiple col
Direct query.SELECT * from A1 t;The data taken at this time is the pre-run data, and other users do not get the data modification at the same time.Real-time update queriesSELECT * FROM A1 t for update;For update updates, other managers can do the data operation with update, which limits the number of users, fewer conne
Tags: style blog color sp data on div log1.update dataUPDATESET= (selectfromwhere t.xh= b.vlbi_ XH)wherelike'14%';2. Judging men and women according to their ID numbers Decode (mod (To_number (substr ( ID number ', 17, 1) ", Span style= "color: #800000; Font-weight:bold; " >2), 0, 2 "" 1 ") A. Intercept the second-to-last digit of the ID first B. is divisible by 2 C. If the remainder is 0, Then 2-female D. If the remainder is not 0, then 1-male
Cp_index_statistics_rec Set is_validate = 1, stat_data = Indexdata, Stat_create_date = (select Sysdate from dual) where stat_date = To_date (To_char (statdate, ' yyyy/mm/dd '), ' yyyy/mm/dd ') and cp_id = cpid and Index_type_code = Indextypecode and Index_item_code = Indexitemcode; Commit End End If; return numb;end Fn_merge_index;Note that the To_date (To_char (statdate, ' yyyy/mm/dd '), ' Yyyy/mm/dd ') is written in To_date (Statdate, ' yyyy/mm/dd '), which, depending on the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.