oracle归并
DECLARE
TYPE num_tt IS TABLE OF INT;
num_t1 num_tt:=num_tt();
num_t2 num_tt:=num_tt();
num_t3 num_tt:=num_tt();
i_1 INT := 1;
j_1 INT := 1;
d_1 INT := 1;
BEGIN
num_t1.extend(20);
num_t2.extend(20);
num_t3.extend(num_t1.count+num_t2.count);
FOR i IN 1..20 LOOP
num_t1(i) := trunc(dbms_random.value(200,100000));
END LOOP;
dbms_output.put_line('num_t1:');
quick_sort(num_t1, 1, num_t1.count);
FOR i IN 1..num_t1.count LOOP
dbms_output.put_line(num_t1(i)||',');
END LOOP;
FOR i IN 1..20 LOOP
num_t2(i) := trunc(dbms_random.value(200,100000));
END LOOP;
dbms_output.put_line('num_t2:');
quick_sort(num_t2, 1, num_t2.count);
FOR i IN 1..num_t2.count LOOP
dbms_output.put_line(num_t2(i)||',');
END LOOP;
WHILE(i_1 <= num_t1.count AND j_1 <= num_t2.count) LOOP
IF(num_t1(i_1) > num_t2(j_1)) THEN
num_t3(d_1) := num_t2(j_1);
j_1 := j_1 + 1;
ELSE
num_t3(d_1) := num_t1(i_1);
i_1 := i_1 + 1;
END IF;
d_1 := d_1 + 1;
END LOOP;
IF(i_1<=num_t1.count) THEN
FOR i IN i_1..num_t1.count LOOP
num_t3(d_1) := num_t1(i);
d_1 := d_1+1;
END LOOP;
ELSE
FOR i IN j_1..num_t2.count LOOP
num_t3(d_1) := num_t2(i);
d_1 := d_1+1;
END LOOP;
END IF;
dbms_output.put_line('num_t3:');
FOR i IN 1..num_t3.count LOOP
dbms_output.put_line(num_t3(i)||',');
END LOOP;
END;
10年积累的成都做网站、网站建设经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站制作后付款的网站建设流程,更有南江免费网站建设让你可以放心的选择与我们合作。
网页名称:oracle归并
文章链接:http://scjbc.cn/article/piopgi.html