In Oracle, compare the data in a table with the input parameters, and perform corresponding operations (Stored Procedures) in Oracle. in Oracle, compare the input data in a table. http://topic.csdn.net/u/20120712/14/7ff39445-a8bc-46fd-a984-64114b2c8e90.html?94669 Table has a number field. The Stored Procedure test has a variable x. \ If there are records y with fields a greater than x in table A, insert y records with fields a equal to x into table a. If field a does not have records greater than x, then all fields a are added with 100. Okay, go directly to the test data [SQL] SQL> select * from t; www.2cto.com A ---------- 1382.4 1920 1500 2975 1500 2850 2940 5000 1800 1320 1368 1560 selected 12 rows. SQL> create or replace procedure emp_test 2 (3 x number 4) www.2cto.com 5 is 6 v_a employee. salary % type; 7 v_count number; 8 I number; 9 begin 10 I: = 0; 11 select count (a) into v_count from t where a> x; 12 if v_count> 0 then 13 for I in 1 .. v_count loop 14 insert into t (a) values (x); 15 end loop; www.2cto.com 16 else 17 update t set a = a + 100; 18 end if; 19 end; 20/the process has been created. The SQL> exec emp_test (9000) PL/SQL process has been completed successfully. SQL> select * from t; A ---------- 1482.4 2020 1600 3075 1600 2950 3040 5100 1900 1420 1468 1660 12 rows have been selected. The SQL> exec emp_test (3000) PL/SQL process has been completed successfully. SQL> select * from t; www.2cto.com A ---------- 1482.4 2020 1600 3075 1600 2950 3040 5100 1900 1420 1468 1660 3000 3000 3000 select 15 rows. Prepared by szstephen Zhou