Have a, b two tables, a table with fields TDZH, WJLJ, id, b table has TDZH, WJLJ, jsydid Will now update id of a table to table b jsydid, judgment conditions are two tables WJLJ and TDZH, but can WJLJ need to capture part of the b table with a table of WJLJ equal, That statement now how to write better? Below is the statement I wrote, but the efficiency is too low
DECLARE CURSOR csr_data IS SELECT * The FROM gltpid; The BEGIN FOR a csr_data IN LOOP The UPDATE dzdagxb b SET B.j sydid=Anderson d WHERE b.w JLJ=substr (b.w JLJ, instr (b.w JLJ, '/', 1, 1), instr (b.w JLJ, '/', 1, 5) + instr (b.w JLJ, '/', 1, 1), 2) And A. d. ah=b.t DZH. END LOOP; END;
CodePudding user response:
Commit more!
CodePudding user response:
add a table a data corresponding to b more than table data, so a table an id will give more than b table data is replaced jsydid
CodePudding user response:
1. Consider the Merge into.
2. B.w JLJ=substr (b.w JLJ, instr (b.w JLJ, '/', 1, 1), instr (b.w JLJ, '/', 1, 5) + instr (b.w JLJ, '/', 1, 1) - (2) How is b field, consider how to optimize the function, can see use regular expressions to make it simple point
3. Try the bulk collect more data. Or commit by number of article.